-
Notifications
You must be signed in to change notification settings - Fork 1
376 lines (363 loc) · 14.4 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:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
linux-native:
timeout-minutes: 3
runs-on: ${{ matrix.machine.os }}
if: success() || failure()
strategy:
fail-fast: false
matrix:
libc: [gnu, musl]
machine:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-24.04-arm
arch: aarch64
env:
target: ${{ matrix.machine.arch }}-unknown-linux-${{ matrix.libc }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Add target
run: rustup target add $target
- name: Test with panic backend (debug)
run: LITHIUM_BACKEND=panic cargo test --target $target
- name: Test with Itanium backend (debug)
run: LITHIUM_BACKEND=itanium cargo test --target $target
- name: Test with std thread locals (debug)
run: LITHIUM_THREAD_LOCAL=std cargo test --target $target
- name: Test with panic backend (release)
run: LITHIUM_BACKEND=panic cargo test --target $target --release
- name: Test with Itanium backend (release)
run: LITHIUM_BACKEND=itanium cargo test --target $target --release
- name: Test with std thread locals (release)
run: LITHIUM_THREAD_LOCAL=std cargo test --target $target --release
linux-cross:
timeout-minutes: 5
runs-on: ubuntu-latest
if: success() || failure()
strategy:
fail-fast: false
matrix:
target:
- aarch64-linux-android
- arm-linux-androideabi
- armv7-linux-androideabi
- arm-unknown-linux-gnueabi
- arm-unknown-linux-gnueabihf
- arm-unknown-linux-musleabi
- arm-unknown-linux-musleabihf
- armv7-unknown-linux-gnueabihf
- i686-unknown-linux-gnu
- i686-unknown-linux-musl
- loongarch64-unknown-linux-gnu
- loongarch64-unknown-linux-musl
- mips64-unknown-linux-gnuabi64
- mips64el-unknown-linux-gnuabi64
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- s390x-unknown-linux-gnu
- sparc64-unknown-linux-gnu
env:
target: ${{ matrix.target }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install Cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Test with panic backend (debug)
run: LITHIUM_BACKEND=panic cross test --target $target
- name: Test with Itanium backend (debug)
run: LITHIUM_BACKEND=itanium cross test --target $target
- name: Test with std thread locals (debug)
run: LITHIUM_THREAD_LOCAL=std cross test --target $target
- name: Test with panic backend (release)
run: LITHIUM_BACKEND=panic cross test --target $target --release
- name: Test with Itanium backend (release)
run: LITHIUM_BACKEND=itanium cross test --target $target --release
- name: Test with std thread locals (release)
run: LITHIUM_THREAD_LOCAL=std cross test --target $target --release
emscripten:
timeout-minutes: 5
runs-on: ubuntu-latest
if: success() || failure()
env:
target: wasm32-unknown-emscripten
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install Cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Test with panic backend (debug)
run: LITHIUM_BACKEND=panic cross test --target $target
- name: Test with Itanium backend (debug)
run: RUSTFLAGS="-Z emscripten_wasm_eh" LITHIUM_BACKEND=itanium cross test --target $target -Z build-std
- name: Test with Emscripten backend (debug)
run: LITHIUM_BACKEND=emscripten cross test --target $target
- name: Test with std thread locals (debug)
run: LITHIUM_THREAD_LOCAL=std cross test --target $target
- name: Test with panic backend (release)
run: LITHIUM_BACKEND=panic cross test --target $target --release
# XXX: https://github.com/rust-lang/rust/issues/132416
# - name: Test with Itanium backend (release)
# run: RUSTFLAGS="-Z emscripten_wasm_eh" LITHIUM_BACKEND=itanium cross test --target $target --release -Z build-std
- name: Test with Emscripten backend (release)
run: LITHIUM_BACKEND=emscripten cross test --target $target --release
- name: Test with std thread locals (release)
run: LITHIUM_THREAD_LOCAL=std cross test --target $target --release
wasi:
timeout-minutes: 3
runs-on: ubuntu-latest
if: success() || failure()
env:
target: wasm32-wasip1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Add target
run: rustup target add $target
- name: Install rust-src
run: rustup component add rust-src
- name: Test with panic backend (debug)
run: LITHIUM_BACKEND=panic ci/cargo-wasi test --target $target
- name: Test with Itanium backend (debug)
run: LITHIUM_BACKEND=itanium ci/cargo-wasi test --target $target
- name: Test with std thread locals (debug)
run: LITHIUM_THREAD_LOCAL=std ci/cargo-wasi test --target $target
- name: Test with panic backend (release)
run: LITHIUM_BACKEND=panic ci/cargo-wasi test --target $target --release
# XXX: Upstream bug at https://github.com/rust-lang/rust/issues/132416
# - name: Test with Itanium backend (release)
# run: LITHIUM_BACKEND=itanium ci/cargo-wasi test --target $target --release
# - name: Test with std thread locals (release)
# run: LITHIUM_THREAD_LOCAL=std ci/cargo-wasi test --target $target --release
darwin:
timeout-minutes: 3
runs-on: ${{ matrix.os }}
if: success() || failure()
strategy:
fail-fast: false
matrix:
os:
- macos-13 # x86_64
- macos-15 # aarch64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Test with panic backend (debug)
run: LITHIUM_BACKEND=panic cargo test
- name: Test with Itanium backend (debug)
run: LITHIUM_BACKEND=itanium cargo test
- name: Test with std thread locals (debug)
run: LITHIUM_THREAD_LOCAL=std cargo test
- name: Test with panic backend (release)
run: LITHIUM_BACKEND=panic cargo test --release
- name: Test with Itanium backend (release)
run: LITHIUM_BACKEND=itanium cargo test --release
- name: Test with std thread locals (release)
run: LITHIUM_THREAD_LOCAL=std cargo test --release
windows:
timeout-minutes: 5
runs-on: windows-latest
if: success() || failure()
strategy:
fail-fast: false
matrix:
arch: [x86_64, i686]
abi: [msvc, gnu, gnullvm]
env:
host: ${{ matrix.arch }}-pc-windows-${{ matrix.abi == 'gnullvm' && 'gnu' || matrix.abi }}
target: ${{ matrix.arch }}-pc-windows-${{ matrix.abi }}
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set default-host
run: rustup set default-host $host
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install and configure LLVM-MinGW
if: matrix.abi == 'gnullvm'
run: >
rustup target add $target &&
curl -L https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-ucrt-x86_64.zip -o llvm-mingw.zip &&
7z x llvm-mingw.zip &&
echo "[target.${{ matrix.arch }}-pc-windows-gnullvm]" >~/.cargo/config.toml &&
echo "linker = '$(pwd -W)/llvm-mingw-20250114-ucrt-x86_64/bin/clang'" >>~/.cargo/config.toml &&
echo "rustflags = ['-C', 'target-feature=+crt-static'${{ matrix.arch == 'i686' && ', ''-C'', ''link-args=-m32''' || '' }}]" >>~/.cargo/config.toml
- name: Test with panic backend (debug)
run: LITHIUM_BACKEND=panic ci/cargo-save "Test with panic backend (debug)" test --target $target
- name: Test with SEH backend (debug)
if: matrix.abi == 'msvc'
run: LITHIUM_BACKEND=seh ci/cargo-save "Test with SEH backend (debug)" test --target $target
- name: Test with Itanium backend (debug)
if: matrix.abi == 'gnu' || matrix.abi == 'gnullvm'
run: LITHIUM_BACKEND=itanium ci/cargo-save "Test with Itanium backend (debug)" test --target $target
- name: Test with std thread locals (debug)
if: matrix.abi == 'msvc' || matrix.abi == 'gnullvm'
run: LITHIUM_THREAD_LOCAL=std ci/cargo-save "Test with std thread locals (debug)" test --target $target
- name: Test with panic backend (release)
run: LITHIUM_BACKEND=panic ci/cargo-save "Test with panic backend (release)" test --target $target --release
- name: Test with SEH backend (release)
if: matrix.abi == 'msvc'
run: LITHIUM_BACKEND=seh ci/cargo-save "Test with SEH backend (release)" test --target $target --release
- name: Test with Itanium backend (release)
if: matrix.abi == 'gnu' || matrix.abi == 'gnullvm'
run: LITHIUM_BACKEND=itanium ci/cargo-save "Test with Itanium backend (release)" test --target $target --release
- name: Test with std thread locals (release)
if: matrix.abi == 'msvc' || matrix.abi == 'gnullvm'
run: LITHIUM_THREAD_LOCAL=std ci/cargo-save "Test with std thread locals (release)" test --target $target --release
- name: Upload built tests for Wine
uses: actions/upload-artifact@v4
with:
name: tests-${{ env.target }}
path: saved-jobs
retention-days: 1
wine:
timeout-minutes: 3
runs-on: ${{ matrix.machine.os }}
needs: windows
strategy:
fail-fast: false
matrix:
machine:
- os: ubuntu-latest
ubuntu_arch: amd64
rust_arch: x86_64
- os: ubuntu-latest
ubuntu_arch: i386
rust_arch: i686
# XXX: We should eventually enable 'gnullvm', too. Itanium under gnullvm is currently broken
# becuase Wine does not currently align module thread locals correctly, and we rely on that.
# https://bugs.winehq.org/show_bug.cgi?id=57700
abi: [msvc, gnu]
env:
WINEDEBUG: fixme+all,err+all # :ferrisClueless:
target: ${{ matrix.machine.rust_arch }}-pc-windows-${{ matrix.abi }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install wine
run: |
set -exuo pipefail
sudo dpkg --add-architecture ${{ matrix.machine.ubuntu_arch }}
sudo apt-get update
sudo apt install wine:${{ matrix.machine.ubuntu_arch }}
wineboot
- name: Download built tests
uses: actions/download-artifact@v4
with:
name: tests-${{ env.target }}
path: saved-jobs
- name: Run tests
run: ci/run-saved-jobs
miri-linux:
timeout-minutes: 5
runs-on: ubuntu-latest
if: success() || failure()
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- i686-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
env:
target: ${{ matrix.target }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install Miri
run: rustup component add miri
- name: Add target
run: rustup target add $target
- name: Test with panic backend
run: LITHIUM_BACKEND=panic cargo miri test --target $target
- name: Test with Itanium backend
run: LITHIUM_BACKEND=itanium cargo miri test --target $target
- name: Test with std thread locals
run: LITHIUM_THREAD_LOCAL=std cargo miri test --target $target
valgrind:
timeout-minutes: 5
runs-on: ubuntu-latest
env:
VALGRINDFLAGS: --suppressions=valgrind.supp
if: success() || failure()
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install cargo valgrind
run: sudo apt-get update && sudo apt-get install valgrind && cargo install cargo-valgrind
- name: Test with panic backend (debug)
run: LITHIUM_BACKEND=panic cargo valgrind test
- name: Test with Itanium backend (debug)
run: LITHIUM_BACKEND=itanium cargo valgrind test
- name: Test with std thread locals (debug)
run: LITHIUM_THREAD_LOCAL=std cargo valgrind test
- name: Test with panic backend (release)
run: LITHIUM_BACKEND=panic cargo valgrind test --release
- name: Test with Itanium backend (release)
run: LITHIUM_BACKEND=itanium cargo valgrind test --release
- name: Test with std thread locals (release)
run: LITHIUM_THREAD_LOCAL=std cargo valgrind test --release
test-stable:
timeout-minutes: 3
runs-on: ubuntu-latest
if: success() || failure()
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable && rustup default stable
- name: Test with panic backend (debug)
run: cargo test
- name: Test with panic backend (release)
run: cargo test --release
lint:
timeout-minutes: 1
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
backend: [panic, itanium, seh, emscripten]
thread_local: [std, attribute]
env:
LITHIUM_BACKEND: ${{ matrix.backend }}
LITHIUM_THREAD_LOCAL: ${{ matrix.thread_local }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install rustfmt and clippy
run: rustup component add rustfmt clippy
- name: Rustfmt
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy -- -D warnings