-
Notifications
You must be signed in to change notification settings - Fork 51
285 lines (239 loc) · 7.11 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
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
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@v4
with:
python-version: "3.11"
- uses: pre-commit/action@v3.0.0
with:
extra_args: --hook-stage manual --all-files
- name: Run PyLint
run: |
echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
pipx run nox -s pylint
- name: Run nox generator
run: |
pipx run nox -s generate_schema -s readme
git diff --exit-code
checks:
name:
Check 🐍 ${{ 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"]
runs-on: [ubuntu-latest, macos-latest]
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.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"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install package
run: pip install -e.[test,test-meta,test-numpy,test-schema,wheels,cov]
- name: Test package
run: >-
pytest -ra --showlocals --cov --cov-report=xml --cov-report=term
--durations=20
- name: Upload coverage report
uses: codecov/codecov-action@v3
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.7", "3.11"]
runs-on: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# The min requirements are not compatible with some of the extra test
# deps, so limit to just built-in deps.
- name: Min requirements
run: pip install --constraint tests/constraints.txt .[test] ninja
- name: Setup CMake ${{ matrix.cmake-version }}
uses: jwlawson/actions-setup-cmake@v1.14
- name: Test min package
run: pytest -ra --showlocals -Wdefault
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@v1
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
- uses: wntrblm/nox@2023.04.22
with:
python-versions: "3.11"
- 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) }}