-
-
Notifications
You must be signed in to change notification settings - Fork 114
80 lines (69 loc) · 2.36 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Test Jellyfin-Kodi
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
PR_TRIGGERED: ${{ github.event_name == 'pull_request' && github.repository == 'jellyfin/jellyfin-kodi' }}
jobs:
test:
strategy:
fail-fast: false
matrix:
py_version: ['2.7', '3.9', '3.11', '3.12']
os: [ubuntu-latest, windows-latest]
exclude:
- os: windows-latest
py_version: '2.7'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py_version }}
if: matrix.py_version != '2.7'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_version }}
- name: Set up Python 2.7
if: matrix.py_version == '2.7'
run: |
sudo apt-get update
sudo apt-get install -y \
python2.7 python2.7-dev python2-pip-whl
sudo ln -sf python2.7 /usr/bin/python
export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl`
sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel
sudo chown -R $USER /usr/local/lib/python2.7
- 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
- name: Run tests and generate coverage
run: |
coverage run
- name: Generate coverage report
run: |
coverage xml
coverage report
- name: Upload coverage
uses: codecov/[email protected]
if: ${{ matrix.py_version == '3.11' }}
- name: Publish Test Artifact
uses: actions/upload-artifact@v3
with:
retention-days: 14
name: ${{ matrix.py_version }}-test-results
path: |
flake8.output
test.xml
coverage.xml