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

70 lines
2.1 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:
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", "3.10" ]
include:
2021-02-09 21:09:58 +01:00
# Kodi Leia on Windows uses a bundled Python 2.7.
- 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 and 3.10 also to be sure.
- os: windows-latest
python-version: "3.8"
- os: windows-latest
python-version: "3.9"
- os: windows-latest
python-version: "3.10"
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
- name: Set up Python ${{ matrix.python-version }}
2022-02-02 17:09:01 +01:00
uses: actions/setup-python@v2
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
uses: codecov/codecov-action@v1
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