Unit Tests #3714
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '**' | |
paths-ignore: | |
- '**.po' | |
- '**.xml' | |
- '**.md' | |
- '**.yml' | |
- '**.properties' | |
- '**.txt' | |
- '**.yaml' | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- '**.po' | |
- '**.xml' | |
- '**.md' | |
- '**.yml' | |
- '**.properties' | |
- '**.txt' | |
- '**.yaml' | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '0 20 * * *' | |
jobs: | |
check-addon: | |
name: Run unit tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04 ] | |
python-version: [ 3.8, 3.9 ] | |
include: | |
# Kodi Matrix on Windows uses a bundled Python 3.8, but we test 3.9 also to be sure. | |
- os: windows-latest | |
python-version: 3.8 | |
- os: windows-latest | |
python-version: 3.9 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
# - name: Set Environment Variables (Linux) | |
# if: ${{ runner.os == 'Linux' }} | |
# run: | | |
# echo PYTHONPATH=$GITHUB_WORKSPACE/kodi.emulator.ascii >> $GITHUB_ENV | |
# echo KODI_HOME=$GITHUB_WORKSPACE/tests/home >> $GITHUB_ENV | |
# | |
# - name: Set Environment Variables (Windows) | |
# if: ${{ runner.os == 'Windows' }} | |
# run: | | |
# echo ("PYTHONPATH=" + $env:GITHUB_WORKSPACE + "\kodi.emulator.ascii") >> $env:GITHUB_ENV | |
# echo ("KODI_HOME=" + $env:GITHUB_WORKSPACE + "\tests\home") >> $env:GITHUB_ENV | |
- name: Run unit tests | |
env: | |
_DPLAY_USERNAME: ${{ secrets.DplayUsername }} | |
_DPLAY_PASSWORD: ${{ secrets.DplayPassword }} | |
RTLXL_USERNAME: ${{ secrets.RtlXlUsername }} | |
RTLXL_PASSWORD: ${{ secrets.RtlXlPassword }} | |
KODI_INTERACTIVE: 0 | |
KODI_HOME: ${{ github.workspace }}/tests/home | |
PYTHONPATH: ${{ github.workspace }}/kodi.emulator.ascii | |
run: | | |
echo "::debug::$GITHUB_ENV" | |
pytest -v --color=yes |