-
Notifications
You must be signed in to change notification settings - Fork 53
376 lines (318 loc) · 9.69 KB
/
ci.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
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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- v[0123456789]*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 3
jobs:
lint:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v4
- name: Install nox
run: uv tool install nox
- uses: pre-commit/[email protected]
with:
extra_args: --all-files
- name: Run PyLint
run: nox -s pylint -- --output-format=github
- name: Run nox generator
run: |
nox -t gen
git diff --exit-code
checks:
name:
🐍 ${{ matrix.python-version }} • CMake ${{ matrix.cmake-version }} on ${{
matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "pypy-3.9", "3.12", "3.13"]
runs-on: [ubuntu-latest, macos-13]
cmake-version: ["3.15.x"]
include:
- python-version: "3.7"
runs-on: windows-2022
cmake-version: "3.21.x"
- python-version: "pypy-3.8"
runs-on: windows-2022
cmake-version: "3.21.x"
- python-version: "3.11"
runs-on: windows-2022
cmake-version: "3.26.x"
- python-version: "pypy-3.7"
runs-on: ubuntu-latest
cmake-version: "3.15.x"
- python-version: "pypy-3.10"
runs-on: ubuntu-latest
cmake-version: "3.15.x"
- python-version: "3.8"
runs-on: ubuntu-latest
cmake-version: "3.21.x"
- python-version: "3.9"
runs-on: ubuntu-latest
cmake-version: "3.20.x"
- python-version: "3.9"
runs-on: macos-13
cmake-version: "3.18.x"
- python-version: "3.12"
runs-on: macos-14
cmake-version: "3.29.x"
- python-version: "3.10"
runs-on: ubuntu-latest
cmake-version: "3.22.x"
- python-version: "3.11"
runs-on: ubuntu-latest
cmake-version: "3.26.x"
- python-version: "3.8"
runs-on: windows-2019
cmake-version: "3.24.x"
- python-version: "3.12"
runs-on: windows-latest
cmake-version: "3.26.x"
- python-version: "3.13"
runs-on: windows-latest
cmake-version: "3.26.x"
- python-version: "3.7"
runs-on: ubuntu-22.04
cmake-version: "3.15.x"
exclude:
- python-version: "3.7"
runs-on: ubuntu-latest
cmake-version: "3.15.x"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: astral-sh/setup-uv@v4
if:
matrix.python-version != '3.7' && matrix.python-version != 'pypy-3.8'
&& matrix.python-version != 'pypy-3.7'
- name: Install package (uv)
if:
matrix.python-version != '3.7' && matrix.python-version != 'pypy-3.8'
&& matrix.python-version != 'pypy-3.7'
run:
uv pip install
-e.[test,test-meta,test-numpy,test-schema,test-hatchling,wheels,cov,wheel-free-setuptools]
--system
- name: Install package (pip)
if:
matrix.python-version == '3.7' || matrix.python-version == 'pypy-3.8'
|| matrix.python-version == 'pypy-3.7'
run:
pip install
-e.[test,test-meta,test-numpy,test-schema,wheels,cov,wheel-free-setuptools]
- name: Test package
if: "!contains(matrix.python_version, 'pypy')"
run: >-
pytest -ra --showlocals --cov --cov-report=xml --cov-report=term
--durations=20
- name: Test package (two attempts)
uses: nick-fields/retry@v3
if: "contains(matrix.python_version, 'pypy')"
with:
max_attempts: 2
retry_on: error
timeout_seconds: 5
command: >-
pytest -ra --showlocals --cov --cov-report=xml --cov-report=term
--durations=20
- name: Upload coverage report
uses: codecov/codecov-action@v5
with:
name:
${{ runner.os }}-${{ matrix.python-version }}-${{
matrix.cmake-version }}
verbose: true
token: 6d9cc0e0-158a-41ee-b8f4-0318d3595ac2
min:
name: Min 🐍 ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.11"]
runs-on: [ubuntu-latest, macos-13, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v4
# The min requirements are not compatible with some of the extra test
# deps, so limit to just built-in deps.
- name: Install extra helpers
run: uv pip install ninja --system
- name: Install min requirements
run: |
uv pip install -e .[test,pyproject] --resolution=lowest-direct --system
- name: Setup CMake 3.15
uses: jwlawson/[email protected]
if: runner.os != 'Windows'
with:
cmake-version: "3.15.x"
# First version to support VS 17.0
- name: Setup CMake 3.21
uses: jwlawson/[email protected]
if: runner.os == 'Windows'
with:
cmake-version: "3.21.x"
- name: Show installed packages
run: pip list
- name: Test min package
run: pytest -ra --showlocals -Wdefault
manylinux:
name: Manylinux on 🐍 3.13 • Free-threaded
runs-on: ubuntu-latest
timeout-minutes: 40
container: quay.io/pypa/musllinux_1_2_x86_64:latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare venv
run: python3.13t -m venv /venv
- name: Install deps
run: /venv/bin/pip install -e .[test] ninja
- name: Test package
run: /venv/bin/pytest
cygwin:
name: Tests on 🐍 3.9 • cygwin
runs-on: windows-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: cygwin/cygwin-install-action@v4
with:
platform: x86_64
packages:
cmake ninja git make gcc-g++ python39 python39-devel python39-pip
- name: Install
run: python3.9 -m pip install .[test]
- name: Test package
run:
python3.9 -m pytest -ra --showlocals -m "not virtualenv"
--durations=20
msys:
name: Tests on 🐍 3 • msys UCRT
runs-on: windows-latest
timeout-minutes: 30
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
path-type: minimal
update: true
install: >-
base-devel git
pacboy: >-
python:p python-pip:p gcc:p cmake:p
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install
run: python -m pip install .[test]
- name: Test package
run: >-
python -m pytest -ra --showlocals -m "not broken_on_urct"
--durations=20
mingw64:
name: Tests on 🐍 3 • mingw64
runs-on: windows-latest
timeout-minutes: 30
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: mingw64
path-type: minimal
update: true
install: >-
base-devel git
pacboy: >-
python:p python-pip:p gcc:p cmake:p
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install
run: python -m pip install .[test]
- name: Test package
run: >-
python -m pytest -ra --showlocals -m "not setuptools" --durations=20
env:
SETUPTOOLS_USE_DISTUTILS: "local"
dist:
name: Distribution build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2
docs:
name: Docs on ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v4
- uses: wntrblm/[email protected]
with:
python-versions: "3.12"
- name: Linkcheck
run: nox -s docs -- -b linkcheck
- name: Manpage
run: nox -s docs -- -b man -W
- name: Build docs with warnings as errors
run: nox -s docs -- -W
- name: Check examples
run: nox -s test_doc_examples
- name: Verify no changes required to API docs
run: |
nox -s build_api_docs
git diff --exit-code
pass:
if: always()
needs: [lint, checks, min, cygwin, dist, docs]
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}