2020-03-23 19:58:55 +01:00
|
|
|
name: CI
|
|
|
|
on:
|
2021-02-09 21:09:58 +01:00
|
|
|
# Run action when pushed to master, or for commits in a pull request.
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-03-23 19:58:55 +01:00
|
|
|
jobs:
|
|
|
|
tests:
|
2020-05-11 14:12:13 +02:00
|
|
|
name: Add-on testing
|
2020-12-17 14:16:49 +01:00
|
|
|
runs-on: ${{ matrix.os }}
|
2020-03-23 19:58:55 +01:00
|
|
|
strategy:
|
2020-03-26 11:31:28 +01:00
|
|
|
fail-fast: false
|
2020-03-23 19:58:55 +01:00
|
|
|
matrix:
|
2021-02-09 21:09:58 +01:00
|
|
|
os: [ ubuntu-latest ]
|
|
|
|
python-version: [ 2.7, 3.5, 3.6, 3.7, 3.8, 3.9 ]
|
2020-12-17 14:16:49 +01:00
|
|
|
include:
|
2021-02-09 21:09:58 +01:00
|
|
|
# Kodi Leia on Windows uses a bundled Python 2.7.
|
2020-12-17 14:16:49 +01:00
|
|
|
- os: windows-latest
|
|
|
|
python-version: 2.7
|
2021-02-09 21:09:58 +01:00
|
|
|
|
|
|
|
# Kodi Matrix on Windows uses a bundled Python 3.8, but we test 3.9 also to be sure.
|
2020-12-17 14:16:49 +01:00
|
|
|
- os: windows-latest
|
|
|
|
python-version: 3.8
|
|
|
|
- os: windows-latest
|
|
|
|
python-version: 3.9
|
2020-03-23 19:58:55 +01:00
|
|
|
steps:
|
2020-03-26 11:31:28 +01:00
|
|
|
- name: Check out ${{ github.sha }} from repository ${{ github.repository }}
|
|
|
|
uses: actions/checkout@v2
|
2021-02-09 21:09:58 +01:00
|
|
|
|
2020-03-23 19:58:55 +01:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2022-02-02 17:09:01 +01:00
|
|
|
uses: actions/setup-python@v2
|
2020-03-23 19:58:55 +01:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2021-02-09 21:09:58 +01:00
|
|
|
|
2020-12-17 14:16:49 +01:00
|
|
|
- name: Install dependencies
|
2021-02-09 21:09:58 +01:00
|
|
|
run: pip install -r requirements.txt
|
|
|
|
|
2020-03-26 11:31:28 +01:00
|
|
|
- name: Run pylint
|
2020-05-11 14:12:13 +02:00
|
|
|
run: make check-pylint
|
2021-02-09 21:09:58 +01:00
|
|
|
|
2020-03-26 11:31:28 +01:00
|
|
|
- name: Check translations
|
2021-02-09 21:09:58 +01:00
|
|
|
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
|
|
|
|
run: sudo apt-get install gettext && make check-translations
|
|
|
|
|
2020-03-26 11:31:28 +01:00
|
|
|
- name: Run unit tests
|
2020-03-23 19:58:55 +01:00
|
|
|
env:
|
|
|
|
ADDON_USERNAME: ${{ secrets.ADDON_USERNAME }}
|
|
|
|
ADDON_PASSWORD: ${{ secrets.ADDON_PASSWORD }}
|
2021-02-09 21:09:58 +01:00
|
|
|
PYTHONIOENCODING: utf-8
|
|
|
|
KODI_HOME: ${{ github.workspace }}/tests/home
|
|
|
|
KODI_INTERACTIVE: 0
|
|
|
|
KODI_STUB_RPC_RESPONSES: ${{ github.workspace }}/tests/rpc
|
|
|
|
HTTP_PROXY: ${{ secrets.HTTP_PROXY }}
|
|
|
|
run: pytest -v --cov=./ --cov-report=xml tests
|
|
|
|
|
2020-03-26 11:31:28 +01:00
|
|
|
- name: Upload code coverage to CodeCov
|
2020-03-23 19:58:55 +01:00
|
|
|
uses: codecov/codecov-action@v1
|
2020-04-01 12:42:04 +02:00
|
|
|
continue-on-error: true
|
2021-02-09 21:09:58 +01:00
|
|
|
env:
|
|
|
|
OS: ${{ matrix.os }}
|
|
|
|
PYTHON: ${{ matrix.python-version }}
|
|
|
|
with:
|
|
|
|
flags: unittests
|
2022-02-02 17:09:01 +01:00
|
|
|
env_vars: OS,PYTHON
|