-
Notifications
You must be signed in to change notification settings - Fork 0
254 lines (243 loc) · 9.51 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
name: CI
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
linux-native:
runs-on: ${{ matrix.os }}
if: success() || failure()
strategy:
fail-fast: false
matrix:
libc: [gnu, musl]
include:
- os: ubuntu-latest
arch: x86_64
- os: buildjet-2vcpu-ubuntu-2204-arm
arch: aarch64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Add target
run: rustup target add ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}
- name: Test with panic backend (debug)
run: LITHIUM_BACKEND=panic cargo test --target ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}
- name: Test with Itanium backend (debug)
run: LITHIUM_BACKEND=itanium cargo test --target ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}
- name: Test without std (debug)
run: cargo test --target ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }} --no-default-features
- name: Test with panic backend (release)
run: LITHIUM_BACKEND=panic cargo test --target ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }} --release
- name: Test with Itanium backend (release)
run: LITHIUM_BACKEND=itanium cargo test --target ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }} --release
- name: Test without std (release)
run: cargo test --target ${{ matrix.arch }}-unknown-linux-${{ matrix.libc }} --release --no-default-features
linux-cross:
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
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 ${{ matrix.target }}
- name: Test with Itanium backend (debug)
run: LITHIUM_BACKEND=itanium cross test --target ${{ matrix.target }}
- name: Test without std (debug)
run: cross test --target ${{ matrix.target }} --no-default-features
- name: Test with panic backend (release)
run: LITHIUM_BACKEND=panic cross test --target ${{ matrix.target }} --release
- name: Test with Itanium backend (release)
run: LITHIUM_BACKEND=itanium cross test --target ${{ matrix.target }} --release
- name: Test without std (release)
run: cross test --target ${{ matrix.target }} --release --no-default-features
emscripten:
runs-on: ubuntu-latest
if: success() || failure()
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 wasm32-unknown-emscripten
- name: Test with Emscripten backend (debug)
run: LITHIUM_BACKEND=emscripten cross test --target wasm32-unknown-emscripten
- name: Test with panic backend (release)
run: LITHIUM_BACKEND=panic cross test --target wasm32-unknown-emscripten --release
- name: Test with Emscripten backend (release)
run: LITHIUM_BACKEND=emscripten cross test --target wasm32-unknown-emscripten --release
darwin:
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 without std (debug)
run: 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 without std (release)
run: cargo test --release
windows:
runs-on: windows-latest
if: success() || failure()
strategy:
fail-fast: false
matrix:
arch: [x86_64, i686]
abi: [msvc, gnu]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set default-host
run: rustup set default-host ${{ matrix.arch }}-pc-windows-${{ matrix.abi }}
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Test with panic backend (debug)
run: set LITHIUM_BACKEND=panic && cargo test
- name: Test with SEH backend (debug)
if: matrix.abi == 'msvc'
run: set LITHIUM_BACKEND=seh && cargo test
- name: Test with Itanium backend (debug)
if: matrix.abi == 'gnu'
run: set LITHIUM_BACKEND=itanium && cargo test
- name: Test without std (debug)
if: matrix.abi == 'msvc'
run: cargo test --no-default-features
- name: Test with panic backend (release)
run: set LITHIUM_BACKEND=panic && cargo test --release
- name: Test with SEH backend (release)
if: matrix.abi == 'msvc'
run: set LITHIUM_BACKEND=seh && cargo test --release
- name: Test with Itanium backend (release)
if: matrix.abi == 'gnu'
run: set LITHIUM_BACKEND=itanium && cargo test --release
- name: Test without std (release)
if: matrix.abi == 'msvc'
run: cargo test --release --no-default-features
miri-linux:
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
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 ${{ matrix.target }}
- name: Test with panic backend
run: LITHIUM_BACKEND=panic cargo miri test --target ${{ matrix.target }}
- name: Test with Itanium backend
run: LITHIUM_BACKEND=itanium cargo miri test --target ${{ matrix.target }}
- name: Test without std
run: cargo miri test --target ${{ matrix.target }} --no-default-features
valgrind:
runs-on: ubuntu-latest
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 without std (debug)
run: cargo valgrind test --no-default-features
- 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 without std (release)
run: cargo valgrind test --release --no-default-features
test-stable:
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:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
backend: [panic, itanium, seh]
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: LITHIUM_BACKEND=${{ matrix.backend }} cargo fmt -- --check
- name: Clippy
run: LITHIUM_BACKEND=${{ matrix.backend }} cargo clippy -- -D warnings
- name: Clippy without std
if: matrix.backend != 'panic'
run: LITHIUM_BACKEND=${{ matrix.backend }} cargo clippy --no-default-features -- -D warnings