2021-05-14 15:18:54 +00:00
|
|
|
name: Test Jellyfin-Kodi
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-10-11 20:57:30 +00:00
|
|
|
pull_request:
|
2021-05-14 15:18:54 +00:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
env:
|
|
|
|
PR_TRIGGERED: ${{ github.event_name == 'pull_request' && github.repository == 'jellyfin/jellyfin-kodi' }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
strategy:
|
2021-10-10 13:31:14 +00:00
|
|
|
fail-fast: false
|
2021-05-14 15:18:54 +00:00
|
|
|
matrix:
|
2024-02-03 21:10:36 +00:00
|
|
|
py_version: ['3.9', '3.11', '3.12']
|
2023-09-22 03:10:13 +00:00
|
|
|
os: [ubuntu-latest, windows-latest]
|
2024-02-03 21:10:36 +00:00
|
|
|
|
2023-09-22 03:10:13 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2021-05-14 15:18:54 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2024-06-12 21:28:59 +00:00
|
|
|
uses: actions/checkout@v4.1.7
|
2021-05-14 15:18:54 +00:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.py_version }}
|
2024-07-10 15:03:51 +00:00
|
|
|
uses: actions/setup-python@v5.1.1
|
2021-05-14 15:18:54 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.py_version }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
python -m pip install -r requirements-dev.txt
|
|
|
|
|
|
|
|
- name: Lint with flake8
|
|
|
|
run: |
|
|
|
|
# stop the build if there are Python syntax errors or undefined names
|
|
|
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
|
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
|
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --output-file=flake8.output
|
|
|
|
cat flake8.output
|
|
|
|
|
2023-10-04 01:09:35 +00:00
|
|
|
- name: Run tests and generate coverage
|
2023-10-03 05:01:47 +00:00
|
|
|
run: |
|
2023-10-04 01:09:35 +00:00
|
|
|
coverage run
|
2023-10-03 05:01:47 +00:00
|
|
|
|
2023-10-04 01:09:35 +00:00
|
|
|
- name: Generate coverage report
|
2021-05-14 15:18:54 +00:00
|
|
|
run: |
|
|
|
|
coverage xml
|
|
|
|
coverage report
|
|
|
|
|
2021-05-23 18:17:34 +00:00
|
|
|
- name: Upload coverage
|
2024-06-13 11:38:11 +00:00
|
|
|
uses: codecov/codecov-action@v4.5.0
|
2023-06-13 15:17:02 +00:00
|
|
|
if: ${{ matrix.py_version == '3.11' }}
|
2021-05-14 15:18:54 +00:00
|
|
|
|
2023-02-07 17:02:24 +00:00
|
|
|
- name: Publish Test Artifact
|
2024-08-30 19:17:26 +00:00
|
|
|
uses: actions/upload-artifact@v4.4.0
|
2021-05-14 15:18:54 +00:00
|
|
|
with:
|
|
|
|
retention-days: 14
|
2024-06-10 04:17:01 +00:00
|
|
|
name: ${{ matrix.py_version }}-${{ matrix.os }}-test-results
|
2021-05-14 15:18:54 +00:00
|
|
|
path: |
|
|
|
|
flake8.output
|
|
|
|
test.xml
|
|
|
|
coverage.xml
|
2024-06-10 10:51:37 +00:00
|
|
|
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-06-10 11:12:59 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-06-10 10:51:37 +00:00
|
|
|
- uses: psf/black@stable
|