-
-
Notifications
You must be signed in to change notification settings - Fork 491
288 lines (264 loc) · 8.6 KB
/
test_pull_requests.yml
File metadata and controls
288 lines (264 loc) · 8.6 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# Our minimal suite of tests that run on each pull request
name: PR Test
on:
pull_request:
branches:
- main
- "v*x"
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
env:
COLUMNS: 120
jobs:
import_lint:
name: Import lint
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python 3.12
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.12
- name: Install dependencies
run: |
pip install --upgrade pip
pip install tox
- name: Run import lint
run: tox -e import-lint
manifest:
# make sure all necessary files will be bundled in the release
name: Check Manifest
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
cache-dependency-path: pyproject.toml
cache: 'pip'
- name: Install Dependencies
run: pip install --upgrade pip
- name: Install Napari dev
run: pip install -e . --group build
env:
PIP_CONSTRAINT: resources/constraints/constraints_py3.12.txt
- name: Make Typestubs
run: |
make typestubs
- name: Check Manifest
run: |
make check-manifest
localization_syntax:
# make sure all necessary files will be bundled in the release
name: Check l18n syntax
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.x"
- name: Check localization formatting
run: |
pip install --upgrade pip semgrep
# f"..." and f'...' are the same for semgrep
semgrep --error --lang python --pattern 'trans._(f"...")' src/napari
semgrep --error --lang python --pattern "trans._(\$X.format(...))" src/napari
build_wheel:
name: Build wheel
uses: ./.github/workflows/reusable_build_wheel.yml
test_initial:
name: Initial test
uses: ./.github/workflows/reusable_run_tox_test.yml
needs: build_wheel
strategy:
fail-fast: false
matrix:
include:
- python: "3.10"
platform: ubuntu-latest
backend: pyqt5
coverage: no_cov
min_req: ""
- python: "3.14"
platform: ubuntu-latest
backend: pyqt6
coverage: no_cov
min_req: ""
with:
python_version: ${{ matrix.python }}
platform: ${{ matrix.platform }}
qt_backend: ${{ matrix.backend }}
coverage: ${{ matrix.coverage }}
min_req: ${{ matrix.MIN_REQ }}
artifacts_suffix: "initial"
test:
name: ${{ matrix.platform }}
uses: ./.github/workflows/reusable_run_tox_test.yml
needs: test_initial
strategy:
fail-fast: false
matrix:
platform: [ ubuntu-latest ]
python: [ "3.13" ]
backend: [ "pyqt5,pyqt6" ]
coverage: [ cov ]
include:
# Windows py310
- python: "3.11"
platform: windows-2022
backend: pyqt5
coverage: no_cov
- python: "3.13"
platform: windows-2022
backend: pyqt6
coverage: cov
- python: "3.13"
platform: macos-15-intel
backend: pyqt5_no_numba
coverage: no_cov
timeout-minutes: 60
- python: "3.13"
platform: macos-latest
backend: pyqt6
coverage: no_cov
timeout-minutes: 60
# minimum specified requirements
- python: "3.10"
platform: ubuntu-22.04
backend: pyqt5
MIN_REQ: 1
coverage: cov
- python: "3.12"
platform: ubuntu-22.04
backend: pyqt6
coverage: cov
tox_extras: "all_optional"
# test without any Qt backends
- python: "3.11"
platform: ubuntu-22.04
backend: headless
coverage: no_cov
# test with torch
- python: "3.13"
platform: ubuntu-latest
backend: pyqt6
coverage: cov
tox_extras: "testing_extra"
# test with no numba
- python: "3.13"
platform: ubuntu-latest
backend: pyqt6_no_numba
coverage: cov
# pyside6 test
- python: "3.13"
platform: ubuntu-latest
backend: pyside6
coverage: cov
# linux aarch64 test
- python: "3.14"
platform: ubuntu-24.04-arm
backend: pyqt6
coverage: cov
with:
python_version: ${{ matrix.python }}
platform: ${{ matrix.platform }}
qt_backend: ${{ matrix.backend }}
min_req: ${{ matrix.MIN_REQ }}
coverage: ${{ matrix.coverage }}
tox_extras: ${{ matrix.tox_extras }}
timeout: ${{ matrix.timeout-minutes || 40 }}
test_pip_install:
needs: test_initial
name: pip install
uses: ./.github/workflows/reusable_pip_test.yml
test_examples:
name: test examples
uses: ./.github/workflows/reusable_run_tox_test.yml
needs: test_initial
with:
toxenv: py312-linux-pyqt6-examples-cov
timeout: 60
python_version: 3.12
constraints_suffix: _examples
coverage: cov
coverage_report:
if: ${{ always() }}
secrets: inherit
needs:
- test
- test_examples
uses: napari/shared-workflows/.github/workflows/upload_coverage.yml@main
with:
artifact-pattern: 'coverage reports*'
test_benchmarks:
name: test benchmarks
runs-on: ubuntu-latest
needs: test_initial
timeout-minutes: 60
env:
GIT_LFS_SKIP_SMUDGE: 1
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.12
cache-dependency-path: pyproject.toml
- name: Setup headless display
uses: pyvista/setup-headless-display-action@5bc8de3bc71fcda7a96439571287a554901541a0 # v4.3
with:
qt: true
wm: herbstluftwm
- name: Download benchmark data
run: |
wget https://data.napari.dev/triangulation-benchmark-shapes.zip
unzip triangulation-benchmark-shapes.zip -d src/napari/benchmarks/
rm triangulation-benchmark-shapes.zip
- uses: octokit/request-action@45eef13998ff762839b0a0de9bbcf41970fd056d # v2.x
# here we get hash of the latest release commit to compare with PR
id: latest_release
with:
route: GET /repos/{owner}/{repo}/releases/latest
owner: napari
repo: napari
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: install dependencies
run: |
pip install --upgrade pip
pip install "asv[virtualenv]"
env:
PIP_CONSTRAINT: resources/constraints/benchmark.txt
- name: asv machine
run: asv machine --yes
- name: Run benchmarks PR
run: |
asv run --show-stderr --quick --attribute timeout=300 HEAD^!
env:
PR: 1 # prevents asv from running very compute-intensive benchmarks
PIP_CONSTRAINT: ${{ github.workspace }}/resources/constraints/benchmark.txt
- name: Run benchmarks latest release
# here we check if the benchmark on the latest release is not broken
run: |
asv run --show-stderr --quick --attribute timeout=300 ${{ fromJSON(steps.latest_release.outputs.data).target_commitish }}^!
env:
PR: 1 # prevents asv from running very compute-intensive benchmarks
PIP_CONSTRAINT: ${{ github.workspace }}/resources/constraints/benchmark.txt
- name: Upload triangulation artifacts
if: failure()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: triangulation-benchmarks
path: /tmp/napari*