-
-
Notifications
You must be signed in to change notification settings - Fork 2
536 lines (523 loc) · 25.8 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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
name: CI
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
- dev
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUST_TEST_THREADS: 1
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
ATOMIC_MAYBE_UNINIT_DENY_WARNINGS: 1
defaults:
run:
shell: bash --noprofile --norc -CeEuxo pipefail {0}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
check-external-types:
uses: taiki-e/github-actions/.github/workflows/check-external-types.yml@main
deny:
uses: taiki-e/github-actions/.github/workflows/deny.yml@main
docs:
uses: taiki-e/github-actions/.github/workflows/docs.yml@main
msrv:
needs: tidy
uses: taiki-e/github-actions/.github/workflows/msrv.yml@main
with:
event_name: ${{ github.event_name }}
tidy:
uses: taiki-e/github-actions/.github/workflows/tidy.yml@main
permissions:
contents: read
pull-requests: write # for gh pr edit --add-assignee
repository-projects: read # for gh pr edit --add-assignee
secrets: inherit
test:
needs: tidy
strategy:
fail-fast: false
matrix:
include:
- rust: '1.59' # LLVM 13
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
- rust: stable
- rust: beta
- rust: nightly
- rust: nightly
flags: -C panic=abort -Z panic_abort_tests
- rust: nightly
flags: -Z codegen-backend=cranelift
- rust: nightly
# target: x86_64-apple-darwin
os: macos-13 # x86_64
- rust: '1.59' # LLVM 13
target: aarch64-apple-darwin
os: macos-latest # AArch64
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: aarch64-apple-darwin
os: macos-latest # AArch64
- rust: stable
target: aarch64-apple-darwin
os: macos-latest # AArch64
- rust: nightly
target: aarch64-apple-darwin
os: macos-latest # AArch64
- rust: '1.59' # LLVM 13
target: aarch64-unknown-linux-gnu
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: aarch64-unknown-linux-gnu
- rust: stable
target: aarch64-unknown-linux-gnu
- rust: nightly
target: aarch64-unknown-linux-gnu
- rust: nightly
target: aarch64-unknown-linux-gnu
flags: -Z codegen-backend=cranelift
- rust: nightly-2021-12-16 # Rust 1.59, LLVM 13 (oldest version we can use stable asm on this target)
target: aarch64_be-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: aarch64_be-unknown-linux-gnu
- rust: nightly-2024-11-07 # TODO: /~https://github.com/BurntSushi/memchr/pull/162
target: aarch64_be-unknown-linux-gnu
- rust: '1.59' # LLVM 13
target: armv5te-unknown-linux-gnueabi
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: armv5te-unknown-linux-gnueabi
- rust: stable
target: armv5te-unknown-linux-gnueabi
- rust: nightly
target: armv5te-unknown-linux-gnueabi
- rust: '1.59' # LLVM 13
target: arm-unknown-linux-gnueabi
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: arm-unknown-linux-gnueabi
- rust: stable
target: arm-unknown-linux-gnueabi
- rust: nightly
target: arm-unknown-linux-gnueabi
- rust: '1.59' # LLVM 13
target: armv7-unknown-linux-gnueabi
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: armv7-unknown-linux-gnueabi
- rust: stable
target: armv7-unknown-linux-gnueabi
- rust: nightly
target: armv7-unknown-linux-gnueabi
- rust: '1.59' # LLVM 13
target: armv7-unknown-linux-gnueabihf
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: armv7-unknown-linux-gnueabihf
- rust: stable
target: armv7-unknown-linux-gnueabihf
- rust: nightly
target: armv7-unknown-linux-gnueabihf
- rust: nightly-2022-09-16 # Rust 1.65, LLVM 15 (version that this target was added)
target: armeb-unknown-linux-gnueabi
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: armeb-unknown-linux-gnueabi
- rust: nightly
target: armeb-unknown-linux-gnueabi
- rust: '1.59' # LLVM 13
target: i586-unknown-linux-gnu
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: i586-unknown-linux-gnu
- rust: stable
target: i586-unknown-linux-gnu
- rust: nightly
target: i586-unknown-linux-gnu
- rust: '1.59' # LLVM 13
target: i686-unknown-linux-gnu
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: i686-unknown-linux-gnu
- rust: stable
target: i686-unknown-linux-gnu
- rust: nightly
target: i686-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
target: hexagon-unknown-linux-musl
- rust: nightly
target: hexagon-unknown-linux-musl
- rust: '1.72' # LLVM 16, inline asm for loongarch has been stabilized in Rust 1.72
target: loongarch64-unknown-linux-gnu
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: loongarch64-unknown-linux-gnu
- rust: stable
target: loongarch64-unknown-linux-gnu
- rust: nightly
target: loongarch64-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
target: mips-unknown-linux-gnu
- rust: nightly
target: mips-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
target: mipsel-unknown-linux-gnu
- rust: nightly
target: mipsel-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
target: mips64-unknown-linux-gnuabi64
- rust: nightly
target: mips64-unknown-linux-gnuabi64
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
target: mips64el-unknown-linux-gnuabi64
- rust: nightly
target: mips64el-unknown-linux-gnuabi64
- rust: nightly-2023-09-20 # Rust 1.74, LLVM 17 (cannot built with nightly-2023-08-24 due to compiler failure from libc when building std)
target: mipsisa32r6-unknown-linux-gnu
- rust: nightly
target: mipsisa32r6-unknown-linux-gnu
- rust: nightly-2023-09-20 # Rust 1.74, LLVM 17 (cannot built with nightly-2023-08-24 due to compiler failure from libc when building std)
target: mipsisa32r6el-unknown-linux-gnu
- rust: nightly
target: mipsisa32r6el-unknown-linux-gnu
- rust: nightly-2023-09-20 # Rust 1.74, LLVM 17 (cannot built with nightly-2023-08-24 due to compiler failure from libc when building std)
target: mipsisa64r6-unknown-linux-gnuabi64
- rust: nightly
target: mipsisa64r6-unknown-linux-gnuabi64
- rust: nightly-2023-09-20 # Rust 1.74, LLVM 17 (cannot built with nightly-2023-08-24 due to compiler failure from libc when building std)
target: mipsisa64r6el-unknown-linux-gnuabi64
- rust: nightly
target: mipsisa64r6el-unknown-linux-gnuabi64
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
target: powerpc-unknown-linux-gnu
- rust: nightly
target: powerpc-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
target: powerpc64-unknown-linux-gnu
- rust: nightly
target: powerpc64-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
target: powerpc64le-unknown-linux-gnu
- rust: nightly
target: powerpc64le-unknown-linux-gnu
- rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
target: riscv32gc-unknown-linux-gnu
- rust: nightly
target: riscv32gc-unknown-linux-gnu
- rust: '1.59' # LLVM 13
target: riscv64gc-unknown-linux-gnu
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: riscv64gc-unknown-linux-gnu
- rust: stable
target: riscv64gc-unknown-linux-gnu
- rust: nightly
target: riscv64gc-unknown-linux-gnu
# TODO: cranelift doesn't support cfg(target_feature): /~https://github.com/rust-lang/rustc_codegen_cranelift/issues/1400
# - rust: nightly
# target: riscv64gc-unknown-linux-gnu
# flags: -Z codegen-backend=cranelift
# - rust: '1.84' # LLVM 19 (oldest stable version we can use asm on this target)
# target: s390x-unknown-linux-gnu
- rust: nightly-2024-01-05 # Rust 1.77, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
target: s390x-unknown-linux-gnu
- rust: nightly
target: s390x-unknown-linux-gnu
- rust: nightly-2024-11-08 # Rust 1.84, LLVM 19 (oldest version we can use asm_experimental_arch on this target)
target: sparc64-unknown-linux-gnu
- rust: nightly
target: sparc64-unknown-linux-gnu
- rust: '1.59' # LLVM 13
target: thumbv7neon-unknown-linux-gnueabihf
- rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
target: thumbv7neon-unknown-linux-gnueabihf
- rust: stable
target: thumbv7neon-unknown-linux-gnueabihf
- rust: nightly
target: thumbv7neon-unknown-linux-gnueabihf
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- run: |
lscpu
# sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils
if: startsWith(matrix.os, 'ubuntu') || matrix.os == ''
- run: |
sysctl hw.optional machdep.cpu
# brew install moreutils
if: startsWith(matrix.os, 'macos')
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: ${{ matrix.rust }}
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-minimal-versions
- uses: taiki-e/install-action@cargo-careful
if: startsWith(matrix.rust, 'nightly')
- uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
if: matrix.target != ''
- run: printf '%s\n' "RUSTFLAGS=${RUSTFLAGS} --cfg qemu" >>"${GITHUB_ENV}"
if: matrix.target != '' && !startsWith(matrix.target, 'i686') && !startsWith(matrix.target, 'x86_64') && !startsWith(matrix.os, 'macos')
- run: |
printf '%s\n' "RUSTFLAGS=${RUSTFLAGS} ${{ matrix.flags }}" >>"${GITHUB_ENV}"
printf '%s\n' "RUSTDOCFLAGS=${RUSTDOCFLAGS} ${{ matrix.flags }}" >>"${GITHUB_ENV}"
if: matrix.flags != ''
- run: printf '%s\n' "TARGET=--target=${{ matrix.target }}" >>"${GITHUB_ENV}"
if: matrix.target != '' && !contains(matrix.target, '-darwin')
# TODO: LLVM bug: Undefined temporary symbol error when building std.
- run: printf 'RELEASE=--release\n' >>"${GITHUB_ENV}"
if: startsWith(matrix.target, 'mips-') || startsWith(matrix.target, 'mipsel-')
- run: tools/test.sh -vv ${TARGET:-} ${DOCTEST_XCOMPILE:-} ${BUILD_STD:-} ${RELEASE:-}
# We test doctest only once with the default build conditions because doctest is slow.
# src/tests has extended copies of doctest, so this will not reduce test coverage.
# x86_64 +cmpxchg16b
# macOS is skipped because it is +cmpxchg16b by default
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
if: (matrix.target == '' || startsWith(matrix.target, 'x86_64')) && !startsWith(matrix.os, 'macos')
# x86 -sse2
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=-sse2
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=-sse2
if: startsWith(matrix.target, 'i686')
# x86 -x87
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+soft-float,-x87,-mmx
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+soft-float,-x87,-mmx
if: startsWith(matrix.target, 'i586')
# aarch64 +lse
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse
# macOS is skipped because it is +rcpc,+lse,+lse2 by default
if: startsWith(matrix.target, 'aarch64') && !contains(matrix.target, '-darwin')
# aarch64 +rcpc,+lse,+lse2
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+rcpc,+lse,+lse2
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+rcpc,+lse,+lse2
# macOS is skipped because it is +rcpc,+lse,+lse2 by default
if: startsWith(matrix.target, 'aarch64') && !contains(matrix.target, '-darwin')
# arm v8 little endian
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+v8
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+v8
if: matrix.target == 'armv7-unknown-linux-gnueabi'
# arm v6 with legacy cp15_barrier
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg atomic_maybe_uninit_use_cp15_barrier
RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg atomic_maybe_uninit_use_cp15_barrier
if: matrix.target == 'arm-unknown-linux-gnueabi'
# arm v7 big endian
# armeb-unknown-linux-gnueabi is v8 by default, use custom target instead
- run: tools/test.sh -vv --tests --target armebv7-unknown-linux-gnueabi -Z build-std ${RELEASE:-}
env:
CARGO_TARGET_ARMEBV7_UNKNOWN_LINUX_GNUEABI_LINKER: armeb-unknown-linux-gnueabi-gcc
CARGO_TARGET_ARMEBV7_UNKNOWN_LINUX_GNUEABI_RUNNER: qemu-armeb
if: startsWith(matrix.rust, 'nightly') && matrix.target == 'armeb-unknown-linux-gnueabi'
# arm v4t
- run: tools/test.sh -vv --tests --target armv4t-unknown-linux-gnueabi -Z build-std ${RELEASE:-}
env:
CARGO_TARGET_ARMV4T_UNKNOWN_LINUX_GNUEABI_LINKER: arm-linux-gnueabi-gcc
CARGO_TARGET_ARMV4T_UNKNOWN_LINUX_GNUEABI_RUNNER: qemu-arm
if: startsWith(matrix.rust, 'nightly') && matrix.target == 'armv5te-unknown-linux-gnueabi'
# powerpc64 pwr7
# powerpc64- (big-endian) is skipped because it is pre-pwr8 by default
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=pwr7
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=pwr7
if: startsWith(matrix.target, 'powerpc64le-')
# powerpc64 pwr8
# powerpc64le- (little-endian) is skipped because it is pwr8 by default
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=pwr8
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=pwr8
if: startsWith(matrix.target, 'powerpc64-')
# powerpc64 pwr10
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=pwr10
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=pwr10
if: startsWith(matrix.target, 'powerpc64')
# riscv +zabha
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+zabha
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+zabha
QEMU_CPU: max
if: startsWith(matrix.target, 'riscv')
# s390x z196 (arch9)
- run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=z196
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=z196
if: startsWith(matrix.target, 's390x')
- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-} --direct
# -Z direct-minimal-versions requires Cargo 1.70.
if: (!(startsWith(matrix.rust, '1.5') || startsWith(matrix.rust, '1.6') || startsWith(matrix.rust, 'nightly-2021') || startsWith(matrix.rust, 'nightly-2022') || startsWith(matrix.rust, 'nightly-2023')))
build:
needs: tidy
strategy:
fail-fast: false
matrix:
rust:
- '1.59'
- stable
- beta
- nightly-2023-08-23 # The last nightly version that doesn't support MaybeUninit registers.
- nightly-2023-08-24 # The oldest nightly version that supports MaybeUninit registers: /~https://github.com/rust-lang/rust/pull/114790
- nightly
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: ${{ matrix.rust }}
- uses: taiki-e/install-action@cargo-hack
- run: tools/build.sh
no-std:
needs: tidy
strategy:
fail-fast: false
matrix:
rust:
- '1.64' # LLVM 14
- stable
- nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
- nightly
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: ${{ matrix.rust }}
- uses: taiki-e/install-action@cargo-hack
if: matrix.rust == 'stable'
- uses: taiki-e/install-action@espup
if: matrix.rust == 'stable'
- run: |
retry() {
for i in {1..10}; do
if "$@"; then
return 0
else
sleep "${i}"
fi
done
"$@"
}
apt_packages=(
qemu-system-arm
qemu-system-misc
)
if [[ "${{ matrix.rust }}" == "nightly"* ]]; then
apt_packages+=(
avr-libc
gcc-avr
simavr
)
if [[ "${{ matrix.rust }}" != "nightly-2023-08-24" ]]; then
apt_packages+=(
libnspr4
mspdebug
)
fi
fi
retry sudo apt-get -o Acquire::Retries=10 -qq update
retry sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends "${apt_packages[@]}"
# APT's qemu package doesn't provide firmware for riscv32: https://packages.ubuntu.com/en/jammy/all/qemu-system-data/filelist
opensbi_version=1.5.1 # /~https://github.com/riscv-software-src/opensbi/releases
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "/~https://github.com/riscv-software-src/opensbi/releases/download/v${opensbi_version}/opensbi-${opensbi_version}-rv-bin.tar.xz" \
| tar xJf -
sudo mv -- "opensbi-${opensbi_version}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin
sudo mv -- "opensbi-${opensbi_version}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.elf" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.elf
rm -rf -- "opensbi-${opensbi_version}-rv-bin"
if [[ "${{ matrix.rust }}" == "nightly"* ]]; then
if [[ "${{ matrix.rust }}" != "nightly-2023-08-24" ]]; then
mkdir -p -- "${HOME}"/{msp430-gcc,sparc-bcc-gcc,tsim}
# https://www.ti.com/tool/MSP430-GCC-OPENSOURCE
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-LlCjWuAbzH/9.3.1.2/msp430-gcc-9.3.1.11_linux64.tar.bz2 \
| tar xjf - --strip-components 1 -C "${HOME}"/msp430-gcc
printf '%s\n' "${HOME}"/msp430-gcc/bin >>"${GITHUB_PATH}"
# https://www.gaisler.com/anonftp/bcc2/bin/
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://www.gaisler.com/anonftp/bcc2/bin/bcc-2.3.1-gcc-sparc-linux64.tar.xz \
| tar xJf - --strip-components 1 -C "${HOME}"/sparc-bcc-gcc
printf '%s\n' "${HOME}"/sparc-bcc-gcc/bin >>"${GITHUB_PATH}"
# https://www.gaisler.com/index.php/downloads/simulators
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://www.gaisler.com/tsim3/tsim-eval/tsim-eval-3.1.11.tar.gz \
| tar xzf - --strip-components 1 -C "${HOME}"/tsim
printf '%s\n' "${HOME}"/tsim/tsim/linux-x64 >>"${GITHUB_PATH}"
fi
elif [[ "${{ matrix.rust }}" == "stable" ]]; then
retry espup install --targets esp32,esp32s2,esp32s3
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: rm -- tests/avr/rust-toolchain.toml
if: startsWith(matrix.rust, 'nightly-')
- run: tools/no-std.sh
- run: tools/build.sh +esp xtensa-esp32-none-elf xtensa-esp32s2-none-elf xtensa-esp32s3-none-elf
if: matrix.rust == 'stable'
- run: tools/no-std.sh +esp xtensa-esp32-none-elf xtensa-esp32s2-none-elf xtensa-esp32s3-none-elf
if: matrix.rust == 'stable'
valgrind:
needs: tidy
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- uses: taiki-e/github-actions/install-rust@nightly
# - run: sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils
- uses: taiki-e/install-action@valgrind
- run: tools/test.sh valgrind -vv
# +cmpxchg16b
- run: tools/test.sh valgrind -vv
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
codegen:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
pull-requests: write # for gh pr edit --add-assignee
repository-projects: read # for gh pr edit --add-assignee
steps:
- uses: taiki-e/checkout-action@v1
- uses: taiki-e/github-actions/install-rust@nightly
- run: tools/target_spec.sh
- id: diff
run: tools/ci/gen.sh
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main')
- id: create-pull-request
uses: peter-evans/create-pull-request@v7
with:
title: Update generated code
body: |
Auto-generated by CI using [create-pull-request](/~https://github.com/peter-evans/create-pull-request).
branch: update-generated-code
token: ${{ secrets.CREATE_PR_TOKEN }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
- name: Notify PR author by assigning PR
run: gh pr edit --add-assignee taiki-e "${PR_NUMBER:?}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
- run: git add -N . && git diff --exit-code