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:
|
2022-02-02 17:49:48 +01:00
|
|
|
- master
|
2021-02-09 21:09:58 +01:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2022-02-02 17:49:48 +01:00
|
|
|
- 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:
|
2023-01-04 14:06:58 +01:00
|
|
|
os: [ ubuntu-latest, windows-latest ]
|
|
|
|
python-version: ["3.8", "3.9", "3.10"]
|
2020-12-17 14:16:49 +01:00
|
|
|
include:
|
2023-01-04 14:06:58 +01:00
|
|
|
# End-of-life Python versions are not available anymore with ubuntu-latest
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
python-version: "2.7"
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
python-version: "3.5"
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
python-version: "3.6"
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
python-version: "3.7"
|
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
|
2022-10-16 15:36:00 +02:00
|
|
|
python-version: "2.7"
|
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 }}
|
2023-01-04 14:06:58 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-02-09 21:09:58 +01:00
|
|
|
|
2020-03-23 19:58:55 +01:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2023-01-04 14:06:58 +01:00
|
|
|
uses: actions/setup-python@v4
|
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 }}
|
2022-02-02 17:49:48 +01:00
|
|
|
run: pytest -x -v --cov=./ --cov-report=xml tests
|
2021-02-09 21:09:58 +01:00
|
|
|
|
2020-03-26 11:31:28 +01:00
|
|
|
- name: Upload code coverage to CodeCov
|
2023-01-04 14:06:58 +01:00
|
|
|
uses: codecov/codecov-action@v3
|
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
|