Run CI on Windows (#62)

* Run CI on Windows

* Don't run service on windows
This commit is contained in:
Michaël Arnauts 2020-12-17 14:16:49 +01:00 committed by GitHub
parent 415a239d82
commit 8a2129b894
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@ on:
jobs: jobs:
tests: tests:
name: Add-on testing name: Add-on testing
runs-on: ubuntu-latest runs-on: ${{ matrix.os }}
env: env:
PYTHONIOENCODING: utf-8 PYTHONIOENCODING: utf-8
PYTHONPATH: ${{ github.workspace }}/resources/lib PYTHONPATH: ${{ github.workspace }}/resources/lib
@ -14,7 +14,17 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
include:
# Kodi Leia on Windows uses a bundled Python 2.7
- os: windows-latest
python-version: 2.7
# Kodi Matrix on Windows uses a bundled Python 3.8
- os: windows-latest
python-version: 3.8
- os: windows-latest
python-version: 3.9
steps: steps:
- name: Check out ${{ github.sha }} from repository ${{ github.repository }} - name: Check out ${{ github.sha }} from repository ${{ github.repository }}
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -22,10 +32,13 @@ jobs:
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies (linux)
if: matrix.os == 'ubuntu-latest'
run: | run: |
sudo apt-get install gettext sudo apt-get install gettext
sudo pip install coverage --install-option="--install-scripts=/usr/bin" sudo pip install coverage --install-option="--install-scripts=/usr/bin"
- name: Install dependencies
run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -r requirements.txt pip install -r requirements.txt
- name: Run pylint - name: Run pylint
@ -33,6 +46,7 @@ jobs:
- name: Run tox - name: Run tox
run: make check-tox run: make check-tox
- name: Check translations - name: Check translations
if: matrix.os == 'ubuntu-latest'
run: make check-translations run: make check-translations
- name: Run unit tests - name: Run unit tests
run: coverage run -m unittest discover run: coverage run -m unittest discover
@ -40,10 +54,12 @@ jobs:
ADDON_PASSWORD: ${{ secrets.ADDON_PASSWORD }} ADDON_PASSWORD: ${{ secrets.ADDON_PASSWORD }}
ADDON_USERNAME: ${{ secrets.ADDON_USERNAME }} ADDON_USERNAME: ${{ secrets.ADDON_USERNAME }}
- name: Run addon service for 10 seconds - name: Run addon service for 10 seconds
if: matrix.os == 'ubuntu-latest'
run: timeout --preserve-status -s SIGINT 10 coverage run -a service_entry.py run: timeout --preserve-status -s SIGINT 10 coverage run -a service_entry.py
env: env:
ADDON_PASSWORD: ${{ secrets.ADDON_PASSWORD }} ADDON_PASSWORD: ${{ secrets.ADDON_PASSWORD }}
ADDON_USERNAME: ${{ secrets.ADDON_USERNAME }} ADDON_USERNAME: ${{ secrets.ADDON_USERNAME }}
- name: Upload code coverage to CodeCov - name: Upload code coverage to CodeCov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1 uses: codecov/codecov-action@v1
continue-on-error: true continue-on-error: true