Repository navigation
130 lines (109 loc) · 3.65 KB
/
Copy pathunit_test.yml
File metadata and controls
130 lines (109 loc) · 3.65 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Unit Tests
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
current:
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'docs:')) }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# ubuntu-latest (26.04) ships no CPython 3.9 build, so pin the
# still-supported 3.9 leg to 24.04 and keep the rest on latest.
include:
- os: ubuntu-24.04
python-version: '3.9'
- os: ubuntu-latest
python-version: '3.10'
- os: ubuntu-latest
python-version: '3.11'
- os: ubuntu-latest
python-version: '3.12'
- os: ubuntu-latest
python-version: '3.13'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Update setuptools
run: |
pip install --upgrade pip
pip install setuptools==68.2.2 wheel==0.41.2
- name: Set PYTHONPATH
run: |
echo "PYTHONPATH=$PYTHONPATH:${{ github.workspace }}/src" >> $GITHUB_ENV
- name: Install dependencies
run: |
export PIP_DEFAULT_TIMEOUT=300
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Show installed pip packages (versions)
run: |
python -m pip list --format=columns
- name: Run current tests with coverage
run: |
coverage run -m pytest tests --ignore=tests/legacy_1x
- name: Generate coverage report
run: |
coverage report -m
legacy:
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'docs:')) }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# ubuntu-latest (26.04) ships no CPython 3.9 build, so pin the
# still-supported 3.9 leg to 24.04 and keep the rest on latest.
include:
- os: ubuntu-24.04
python-version: '3.9'
- os: ubuntu-latest
python-version: '3.10'
- os: ubuntu-latest
python-version: '3.11'
- os: ubuntu-latest
python-version: '3.12'
- os: ubuntu-latest
python-version: '3.13'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Update setuptools
run: |
pip install --upgrade pip
pip install setuptools==68.2.2 wheel==0.41.2
- name: Set PYTHONPATH
run: |
echo "PYTHONPATH=$PYTHONPATH:${{ github.workspace }}/src" >> $GITHUB_ENV
- name: Install dependencies
run: |
export PIP_DEFAULT_TIMEOUT=300
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Run archived legacy tests
run: |
python -m pytest tests/legacy_1x