plugin.video.viervijfzes/.github/workflows/ci.yml

66 lines
2.0 KiB
YAML
Raw Normal View History

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
2021-02-09 21:09:58 +01:00
pull_request:
branches:
- master
jobs:
tests:
name: Add-on testing
runs-on: ${{ matrix.os }}
strategy:
2020-03-26 11:31:28 +01:00
fail-fast: false
matrix:
2023-01-04 14:06:58 +01:00
os: [ ubuntu-latest, windows-latest ]
python-version: ["3.8", "3.9", "3.10"]
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: "3.5"
- os: ubuntu-20.04
python-version: "3.6"
- os: ubuntu-20.04
python-version: "3.7"
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
- name: Set up Python ${{ matrix.python-version }}
2023-01-04 14:06:58 +01:00
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
2021-02-09 21:09:58 +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
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
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 -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
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