-
Notifications
You must be signed in to change notification settings - Fork 14
329 lines (321 loc) · 10.2 KB
/
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
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
name: Unit tests
on: [push, pull_request]
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test-cxx:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
cxx: g++-9
extras: enabled
- os: ubuntu-22.04
cxx: g++-12
extras: enabled
- os: ubuntu-20.04
cxx: clang++-10
extras: enabled
- os: ubuntu-22.04
cxx: clang++-14
extras: enabled
- os: macos-14
cxx: clang++
extras: disabled
runs-on: ${{ matrix.os }}
env:
SCCACHE_GHA_ENABLED: "true"
CXX: sccache ${{ matrix.cxx }}
# Don't error on deprecations: Xcode marks sprintf deprecated and Boost references it
CXXFLAGS: -Wno-error=deprecated-declarations
steps:
- uses: actions/checkout@v4
- name: Set up sccache
uses: mozilla-actions/[email protected]
- name: Install system packages
run: ./.ci/install-sys-pkgs.sh
- uses: actions/setup-python@v5
with:
# 3.10 is the minimum version supported on macos-14 builders
python-version: '3.10'
cache: 'pip'
- name: Install build requirements
run: ./.ci/py-build-requirements.sh
- name: Set up build directory
run: >-
meson setup build
--native-file=ci.ini
-Dwerror=true
-Dauto_features=${{ matrix.extras }}
-Dcuda=disabled
-Dgdrapi=disabled
-Dfmv="$(if [[ '${{ matrix.cxx }}' == g++* ]]; then echo enabled; else echo disabled; fi)"
- name: Build
run: meson compile -C build
- name: Run tests
run: meson test -C build
test-python:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
cc: gcc-9
cxx: g++-9
python-version: '3.8'
extras: enabled
# Disabled for now because numba/llvmlite (needed for tests)
# doesn't have a pypy wheel, and it's not worth the effect to
# install all the dependencies needed to make that work.
# - os: ubuntu-22.04
# cxx: g++
# python-version: pypy-3.7
- os: ubuntu-22.04
cc: gcc-12
cxx: g++-12
python-version: '3.12'
extras: enabled
- os: ubuntu-20.04
cc: clang-10
cxx: clang++-10
python-version: '3.12'
extras: enabled
- os: ubuntu-22.04
cc: clang-14
cxx: clang++-14
python-version: '3.12'
extras: enabled
- os: macos-14
cc: clang
cxx: clang++
python-version: '3.12'
extras: disabled
runs-on: ${{ matrix.os }}
env:
SCCACHE_GHA_ENABLED: "true"
CXX: sccache ${{ matrix.cxx }}
# Don't error on deprecations: Xcode marks sprintf deprecated and Boost references it
CXXFLAGS: -Wno-error=deprecated-declarations
steps:
- uses: actions/checkout@v4
- name: Set up sccache
uses: mozilla-actions/[email protected]
- name: Install system packages
run: ./.ci/install-sys-pkgs.sh
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Python dependencies
run: ./.ci/py-requirements.sh
env:
CC: ${{ matrix.cc }} # Do not pass -Werror when building dependencies
- name: Install Python package
run: >-
pip install -v
--config-settings=setup-args=--native-file=ci.ini
--config-settings=setup-args=-Dwerror=true
--config-settings=setup-args=-Dauto_features=${{ matrix.extras }}
--config-settings=setup-args=-Dfmv="$(if [[ '${{ matrix.cxx }}' == g++* ]]; then echo enabled; else echo disabled; fi)"
.
- name: Run tests
run: pytest -v -ra # -ra summarises the reasons for skipping or failing tests
- name: Run shutdown tests
run: ./.ci/py-tests-shutdown.sh
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- uses: actions/setup-python@v5
with:
python-version: '3.8'
cache: 'pip'
- run: pip install pre-commit
- run: pre-commit run --all-files
coverage:
runs-on: ubuntu-22.04
env:
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v4
- name: Set up sccache
uses: mozilla-actions/[email protected]
- name: Install system packages
run: ./.ci/install-sys-pkgs.sh
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install Python dependencies
run: ./.ci/py-requirements.sh
- name: Install build requirements
run: ./.ci/py-build-requirements.sh
- name: Install Python package
# Build isolation tends to delete the .gcno files which end up in
# the ephemeral build directory. So do a non-isolated editable
# install instead.
run: >-
pip install -v
--config-settings=setup-args=-Dwerror=true
--config-settings=setup-args=-Dauto_features=enabled
--config-settings=setup-args=-Dbuildtype=debug
--config-settings=setup-args=-Db_coverage=true
--no-build-isolation
--editable .
- name: Run Python tests
run: pytest -v -ra && ./.ci/py-tests-shutdown.sh
- name: Set up C++ build
run: >-
meson setup build
-Dwerror=true
-Dauto_features=enabled
-Dcuda=disabled
-Dgdrapi=disabled
-Dbuildtype=debug
-Db_coverage=true
- name: Build C++
run: meson compile -C build
- name: Run C++ tests
run: meson test -C build
- name: Collect coverage
run: ./.ci/coverage.sh
- uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info
all-builds:
runs-on: ubuntu-22.04
env:
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- uses: actions/checkout@v4
- name: Set up sccache
uses: mozilla-actions/[email protected]
- name: Install system packages
run: ./.ci/install-sys-pkgs.sh
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install build requirements
run: ./.ci/py-build-requirements.sh
- name: Build all the combinations
run: ./.ci/all-builds.sh
sdist:
needs: [test-cxx, test-python, coverage, lint]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install system packages
run: ./.ci/install-sys-pkgs.sh
- name: Install Python dependencies
run: ./.ci/py-requirements.sh
- run: pip install build==1.2.1
- run: python -m build --sdist .
- uses: actions/upload-artifact@v4
with:
name: sdist
path: ./dist/*.tar.gz
cibuildwheel-linux:
needs: [test-cxx, test-python, coverage, lint]
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
python: [cp38, cp39, cp310, cp311, cp312]
env:
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v4
- name: Set up sccache
uses: mozilla-actions/[email protected]
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
if: matrix.arch != 'x86_64'
- uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.python }}-manylinux*
- uses: actions/upload-artifact@v4
with:
name: wheel_linux-${{ matrix.arch }}-${{ matrix.python }}
path: ./wheelhouse/*.whl
- uses: actions/upload-artifact@v4
with:
name: debug_symbols_uncompressed-${{ matrix.arch }}-${{ matrix.python }}
path: ./wheelhouse/*.debug
cibuildwheel-macos:
needs: [test-cxx, test-python, coverage, lint]
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14]
python: [cp38, cp39, cp310, cp311, cp312]
exclude:
# Python 3.8 not natively available for Apple Silicon. cibuildwheel
# tries to do a cross build, which fails.
- os: macos-14
python: cp38
runs-on: ${{ matrix.os }}
env:
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v4
- name: Set up sccache
uses: mozilla-actions/[email protected]
- uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-macos*
- uses: actions/upload-artifact@v4
with:
name: wheel_macos-${{ matrix.os }}-${{ matrix.python }}
path: ./wheelhouse/*.whl
combine:
needs: [cibuildwheel-linux, cibuildwheel-macos, sdist]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Create paths
run: mkdir -p debug-symbols dist wheelhouse
- uses: actions/download-artifact@v4
with:
pattern: debug_symbols_uncompressed-*
path: .
merge-multiple: true
- uses: actions/download-artifact@v4
with:
pattern: wheel_*
path: wheelhouse/
merge-multiple: true
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist/
merge-multiple: true
- name: Compress debug symbols
run: >-
tar -Jcvf debug-symbols/"spead2-"$(<VERSION.txt)-debug.tar.xz _spead2*.debug
- uses: actions/upload-artifact@v4
with:
name: combined
path: |
debug-symbols/
dist/
wheelhouse/