-
Notifications
You must be signed in to change notification settings - Fork 27
74 lines (66 loc) · 2.57 KB
/
master-test.yml
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
name: tests
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
jobs:
tests:
runs-on: ${{ matrix.arrays.os }}
strategy:
matrix:
arrays: [
# {os: ubuntu-22.04, python-version: '3.7.17'}, # multiline code is depicted differently
{os: ubuntu-22.04, python-version: '3.8'},
{os: ubuntu-22.04, python-version: '3.9'},
{os: ubuntu-22.04, python-version: '3.10'},
{os: ubuntu-22.04, python-version: '3.11'},
{os: ubuntu-22.04, python-version: '3.12'},
{os: ubuntu-22.04, python-version: '3.13'},
# {os: ubuntu-22.04, python-version: '3.14.0-alpha.5'}, # too early
# {os: windows-latest, python-version: '3.7.9'}, # multiline code is depicted differently
{os: windows-latest, python-version: '3.8'},
{os: windows-latest, python-version: '3.9'},
{os: windows-latest, python-version: '3.10'},
{os: windows-latest, python-version: '3.11'},
{os: windows-latest, python-version: '3.12'},
{os: windows-latest, python-version: '3.13'}
# {os: windows-latest, python-version: '3.14.0-alpha.5'} # too early
]
steps:
- name: Set up Python ${{ matrix.arrays.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.arrays.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest-cov ipython notebook==6.2.0
- name: Checkout code
uses: actions/checkout@v2
- name: Lint with flake8
run: |
flake8 traceback_with_variables --count --show-source --statistics --max-line-length=127
- name: Test with pytest
env:
PYTHONHASHSEED: 1
run: |
python -Xfrozen_modules=off -m pytest -vv --cov=traceback_with_variables --cov-report=json
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.arrays.os }}-${{ matrix.arrays.python-version }}
path: coverage.json
coverage:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download all coverage reports
uses: actions/download-artifact@v4
with:
path: coverage-reports
- name: Check coverage
run: python3 check_coverage_reports.py --inp-dir coverage-reports --max-allowed-num-uncovered-lines 0