2cd40ea1 Andy McCall 1 month ago ↶
1
name : build
2
3
on :
4
push :
5
branches :
6
- main
7
pull_request :
8
branches : [ " **" ]
9
schedule :
10
11
- cron : " 25 23 * * 4"
12
workflow_dispatch :
13
14
permissions : { }
15
16
jobs :
17
test :
18
strategy :
19
fail-fast : false
20
matrix :
21
runs-on : [ ubuntu-22.04 , windows-2022 , macos-latest ]
22
toolchain :
23
- " 1.62"
24
- stable
25
- nightly
26
versions :
27
- " "
28
- -Zminimal-versions
29
exclude :
30
31
32
- toolchain : " 1.62"
33
versions : " "
34
35
- toolchain : nightly
36
versions : -Zminimal-versions
37
runs-on : ${{ matrix.runs-on }}
38
steps :
39
- name : Checkout
40
uses : actions/checkout@v6
41
with :
42
persist-credentials : false
43
- name : Install Rust
44
run : |
45
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --no-self-update
46
rustup default ${{ matrix.toolchain }}
47
- name : Update lockfile
48
run : cargo generate-lockfile ${{ matrix.versions }}
49
env :
50
RUSTC_BOOTSTRAP : 1
51
- run : cargo test --all-targets
52
- run : cargo run --example stress-test
53
54
build-wasm :
55
strategy :
56
fail-fast : false
57
matrix :
58
versions :
59
- " "
60
- -Zminimal-versions
61
toolchain :
62
- stable
63
- nightly
64
include :
65
66
- versions : -Zminimal-versions
67
- toolchain : " 1.62"
68
runs-on : ubuntu-latest
69
steps :
70
- name : Checkout
71
uses : actions/checkout@v6
72
with :
73
persist-credentials : false
74
- name : Install Rust
75
run : |
76
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --no-self-update --target wasm32-unknown-unknown
77
rustup default ${{ matrix.toolchain }}
78
- name : Update lockfile
79
run : cargo generate-lockfile ${{ matrix.versions }}
80
env :
81
RUSTC_BOOTSTRAP : 1
82
- run : cargo build --lib
83
84
test-wasm :
85
strategy :
86
fail-fast : false
87
matrix :
88
toolchain :
89
- stable
90
- nightly
91
runs-on : ubuntu-latest
92
steps :
93
- name : Checkout
94
uses : actions/checkout@v6
95
with :
96
persist-credentials : false
97
- name : Install Rust
98
run : |
99
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --no-self-update --target wasm32-unknown-unknown
100
rustup default ${{ matrix.toolchain }}
101
- name : Install Node
102
uses : actions/setup-node@v6
103
with :
104
node-version : " lts/*"
105
- name : Install "wasm-pack"
106
uses : taiki-e/install-action@v2
107
with :
108
tool : wasm-pack
109
- run : wasm-pack test --node
110
111
test-wasi :
112
strategy :
113
fail-fast : false
114
matrix :
115
toolchain :
116
- stable
117
- nightly
118
runs-on : ubuntu-latest
119
steps :
120
- name : Checkout
121
uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
122
with :
123
persist-credentials : false
124
- name : Install Rust
125
run : |
126
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --no-self-update --target wasm32-wasip1
127
rustup default ${{ matrix.toolchain }}
128
- env :
129
CARGO_BUILD_TARGET : wasm32-wasip1
130
run : cargo build --release --examples
131
- name : Install wasmtime
132
uses : bytecodealliance/actions/wasmtime/setup@6aecabac1eb1dcf7ed94ba9471974415ee2ebef2
133
- name : Run example using wasmtime
134
run : wasmtime ./target/wasm32-wasip1/release/examples/get_timezone.wasm
135
136
test-emscripten :
137
strategy :
138
fail-fast : false
139
matrix :
140
toolchain :
141
- stable
142
- nightly
143
runs-on : ubuntu-latest
144
steps :
145
- name : Checkout
146
uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
147
with :
148
persist-credentials : false
149
- name : Install Rust
150
run : |
151
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --no-self-update --target wasm32-unknown-emscripten
152
rustup default ${{ matrix.toolchain }}
153
- uses : mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021
154
- env :
155
CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER : node
156
CARGO_BUILD_TARGET : wasm32-unknown-emscripten
157
run : cargo test
158
159
build-cross :
160
strategy :
161
fail-fast : false
162
matrix :
163
target :
164
- s390x-unknown-linux-gnu
165
- x86_64-unknown-freebsd
166
- x86_64-unknown-illumos
167
168
169
170
171
172
versions :
173
- " "
174
- -Zminimal-versions
175
runs-on : ubuntu-latest
176
steps :
177
- name : Checkout
178
uses : actions/checkout@v6
179
with :
180
persist-credentials : false
181
- name : Install Rust
182
run : |
183
rustup toolchain install stable --profile minimal --no-self-update --target ${{ matrix.target }}
184
- name : Update lockfile
185
run : cargo generate-lockfile ${{ matrix.versions }}
186
env :
187
RUSTC_BOOTSTRAP : 1
188
189
- name : Install "cross"
190
uses : taiki-e/install-action@v2
191
with :
192
tool : cross
193
194
- run : cross build --target ${{ matrix.target }} --examples
195
196
build-android :
197
runs-on : ubuntu-latest
198
steps :
199
- name : Checkout
200
uses : actions/checkout@v6
201
with :
202
persist-credentials : false
203
- name : Install Rust
204
run : rustup toolchain install stable --profile minimal --no-self-update
205
- name : Add Rust components
206
run : rustup component add clippy rust-src
207
- name : Add Rust toolchain
208
run : rustup target add aarch64-linux-android armv7-linux-androideabi
209
- name : Setup Android NDK
210
uses : nttld/setup-ndk@v1
211
id : setup-ndk
212
with :
213
ndk-version : r25b
214
local-cache : true
215
216
- name : Install "cargo ndk"
217
uses : taiki-e/install-action@v2
218
with :
219
tool : cargo-ndk
220
221
- name : Check
222
run : cargo ndk check --lib
223
env :
224
ANDROID_NDK_HOME : ${{ steps.setup-ndk.outputs.ndk-path }}
225
226
- name : Clippy
227
run : cargo ndk clippy --lib
228
env :
229
ANDROID_NDK_HOME : ${{ steps.setup-ndk.outputs.ndk-path }}
230
231
- name : Build library
232
run : cargo ndk build --lib
233
env :
234
ANDROID_NDK_HOME : ${{ steps.setup-ndk.outputs.ndk-path }}
235
236
build-ios-cross :
237
strategy :
238
fail-fast : false
239
matrix :
240
toolchain :
241
- " 1.62"
242
- stable
243
target :
244
- x86_64-apple-ios
245
versions :
246
- " "
247
- -Zminimal-versions
248
exclude :
249
250
251
- toolchain : " 1.62"
252
versions : " "
253
runs-on : macos-latest
254
steps :
255
- name : Checkout
256
uses : actions/checkout@v6
257
with :
258
persist-credentials : false
259
- name : Install Rust
260
run : |
261
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --no-self-update --target ${{ matrix.target }}
262
rustup default ${{ matrix.toolchain }}
263
- name : Update lockfile
264
run : cargo generate-lockfile ${{ matrix.versions }}
265
env :
266
RUSTC_BOOTSTRAP : 1
267
- name : Install "cross"
268
run : curl --location --silent --show-error --fail https://github.com/cargo-bins/cargo-quickinstall/releases/download/cross-0.2.5/cross-0.2.5-x86_64-apple-darwin.tar.gz | tar -xzvvf - -C $HOME/.cargo/bin
269
- run : cross build --target ${{ matrix.target }} --examples
270
271
check :
272
strategy :
273
fail-fast : false
274
matrix :
275
toolchain :
276
- " 1.62"
277
- stable
278
- nightly
279
versions :
280
- " "
281
- -Zminimal-versions
282
exclude :
283
284
285
- toolchain : " 1.62"
286
versions : " "
287
runs-on : ubuntu-latest
288
env :
289
RUSTFLAGS : -D warnings
290
RUST_BACKTRACE : 1
291
steps :
292
- name : Checkout
293
uses : actions/checkout@v6
294
with :
295
persist-credentials : false
296
- name : Install Rust
297
run : |
298
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --no-self-update --component clippy
299
rustup default ${{ matrix.toolchain }}
300
- name : Update lockfile
301
run : cargo generate-lockfile ${{ matrix.versions }}
302
env :
303
RUSTC_BOOTSTRAP : 1
304
- run : cargo check --all-targets --workspace
305
- run : cargo clippy --all-targets --workspace -- -D warnings
306
307
no-docker-image-check-only :
308
runs-on : ubuntu-latest
309
steps :
310
- name : Checkout
311
uses : actions/checkout@v6
312
with :
313
persist-credentials : false
314
- name : Install Rust
315
run : |
316
rustup toolchain install nightly --profile minimal --no-self-update --component rust-src
317
rustup default nightly
318
- run : cargo check --target x86_64-unknown-haiku -Z build-std --examples
319
320
doc :
321
runs-on : ubuntu-latest
322
steps :
323
- name : Checkout
324
uses : actions/checkout@v6
325
with :
326
persist-credentials : false
327
- name : Install Rust
328
run : |
329
rustup toolchain install nightly --profile minimal --no-self-update
330
rustup default nightly
331
- run : RUSTDOCFLAGS="-D warnings" cargo doc --all-features
332
333
audit :
334
runs-on : ubuntu-latest
335
steps :
336
- name : Checkout
337
uses : actions/checkout@v6
338
with :
339
persist-credentials : false
340
- uses : EmbarkStudios/cargo-deny-action@v2
341
342
fallback :
343
runs-on : ubuntu-latest
344
steps :
345
- name : Checkout
346
uses : actions/checkout@v6
347
with :
348
persist-credentials : false
349
- name : Install Rust
350
run : |
351
rustup toolchain install stable --profile minimal --no-self-update --target x86_64-fortanix-unknown-sgx
352
353
- run : if cargo build --lib --target x86_64-fortanix-unknown-sgx; then exit 1; fi
354
355
- run : cargo build --lib --target x86_64-fortanix-unknown-sgx --features fallback
356
357
c :
358
name : Lint and format C
359
runs-on : ubuntu-latest
360
steps :
361
- name : Checkout repository
362
uses : actions/checkout@v6
363
with :
364
persist-credentials : false
365
366
- name : Setup Node.js runtime
367
uses : actions/setup-node@v6
368
with :
369
node-version : " lts/*"
370
- name : Install npm
371
run : npm i -f -g [email protected]
372
373
- name : Lint and check formatting with clang-format
374
run : npx github:artichoke/clang-format --check
375
376
test-haiku :
377
strategy :
378
fail-fast : false
379
matrix :
380
runs-on : [ ubuntu-22.04 , windows-2022 , macos-latest ]
381
toolchain :
382
- stable
383
versions :
384
- " "
385
runs-on : ${{ matrix.runs-on }}
386
env :
387
RUSTFLAGS : -D warnings
388
RUST_BACKTRACE : 1
389
steps :
390
- name : Checkout
391
uses : actions/checkout@v6
392
with :
393
persist-credentials : false
394
- name : Install Rust
395
run : |
396
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --no-self-update --target x86_64-fortanix-unknown-sgx
397
rustup default ${{ matrix.toolchain }}
398
- name : Update lockfile
399
run : cargo generate-lockfile ${{ matrix.versions }}
400
working-directory : haiku
401
env :
402
RUSTC_BOOTSTRAP : 1
403
- run : cargo test --all-targets
404
working-directory : haiku
405
406
check-haiku :
407
strategy :
408
fail-fast : false
409
matrix :
410
toolchain :
411
- stable
412
versions :
413
- " "
414
runs-on : ubuntu-latest
415
env :
416
RUSTFLAGS : -D warnings
417
RUST_BACKTRACE : 1
418
steps :
419
- name : Checkout
420
uses : actions/checkout@v6
421
with :
422
persist-credentials : false
423
- name : Install Rust
424
run : |
425
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --no-self-update --component clippy
426
rustup default ${{ matrix.toolchain }}
427
- name : Update lockfile
428
run : cargo generate-lockfile ${{ matrix.versions }}
429
working-directory : haiku
430
env :
431
RUSTC_BOOTSTRAP : 1
432
- run : cargo check --all-targets
433
working-directory : haiku
434
- run : cargo clippy --all-targets -- -D warnings
435
working-directory : haiku
436
437
check-all-versions :
438
runs-on : ubuntu-22.04
439
steps :
440
- name : Checkout
441
uses : actions/checkout@v6
442
with :
443
persist-credentials : false
444
445
- name : Install Rust
446
run : |
447
rustup toolchain install nightly --profile minimal --no-self-update
448
rustup default nightly
449
450
- name : Install "cargo hack"
451
uses : taiki-e/install-action@v2
452
with :
453
tool : cargo-hack
454
455
- run : cargo hack check --version-range .. --version-step 2 --clean-per-version --clean-per-run
456
457
generate-windows-bindings :
458
name : Generate windows-core bindings with windows-bindgen
459
runs-on : ubuntu-latest
460
steps :
461
- uses : actions/checkout@v6
462
with :
463
persist-credentials : false
464
- name : Clean
465
run : rm -rf src/Windows.rs
466
- name : Generate
467
run : cargo r --manifest-path=api_gen/Cargo.toml
468
- name : Diff generated Rust code
469
run : test -z "$(git status --porcelain)" || (echo "::error::Generated files are different, please regenerate with cargo run --manifest-path=api_gen/Cargo.toml!"; git status; false)
470
471
typos :
472
runs-on : ubuntu-latest
473
steps :
474
- uses : actions/checkout@v6
475
with :
476
persist-credentials : false
477
- uses : crate-ci/typos@master
478
479
devskim :
480
runs-on : ubuntu-latest
481
permissions :
482
actions : read
483
contents : read
484
security-events : write
485
steps :
486
- uses : actions/checkout@v6
487
with :
488
persist-credentials : false
489
- name : Run DevSkim scanner
490
uses : microsoft/DevSkim-Action@v1
491
- name : Upload DevSkim scan results to GitHub Security tab
492
uses : github/codeql-action/upload-sarif@v4
493
with :
494
sarif_file : devskim-results.sarif