-
-
Notifications
You must be signed in to change notification settings - Fork 16
531 lines (514 loc) · 25.6 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
name: CI
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
- dev
schedule:
- cron: '0 1 * * *'
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
# NB: sync with:
# - docs.rs metadata in Cargo.toml
# - test_features list in tools/build.sh and tools/test.sh.
TEST_FEATURES: float,std,serde,critical-section
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
# check-external-types:
# uses: taiki-e/workflows/.github/workflows/check-external-types.yml@main
# deny:
# uses: taiki-e/workflows/.github/workflows/deny.yml@main
# docs:
# uses: taiki-e/workflows/.github/workflows/docs.yml@main
# with:
# target: x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,powerpc64le-unknown-linux-gnu,s390x-unknown-linux-gnu,armv5te-unknown-linux-gnueabi
# msrv:
# needs: tidy
# uses: taiki-e/workflows/.github/workflows/msrv.yml@main
# with:
# event_name: ${{ github.event_name }}
# # Exclude serde and critical-section features because the MSRV when it is enabled depends on the MSRV of them
# args: -vvv --clean-per-version --feature-powerset --depth 2 --optional-deps --exclude-features serde,critical-section,unsafe-assume-single-core,s-mode,disable-fiq
# tidy:
# uses: taiki-e/workflows/.github/workflows/tidy.yml@main
# with:
# # clippy is covered by TESTS=1 ./tools/build.sh
# clippy: false
test:
# needs: tidy
strategy:
fail-fast: false
matrix:
include:
# - rust: '1.56'
# - rust: '1.59' # LLVM 13
# - rust: '1.64' # LLVM 14
# - rust: '1.69' # LLVM 15
# - rust: stable # LLVM 16 (as of 1.70)
# - rust: beta
# - rust: nightly
# - rust: nightly
# os: macos-latest
# - rust: nightly
# os: windows-latest
# - rust: nightly-x86_64-pc-windows-gnu
# os: windows-latest
# - rust: nightly-i686-pc-windows-msvc
# os: windows-latest
# - rust: nightly-i686-pc-windows-gnu
# os: windows-latest
- rust: nightly
flags: -C panic=abort -Z panic_abort_tests
# - rust: '1.59' # LLVM 13
# target: aarch64-unknown-linux-gnu
# - rust: '1.64' # LLVM 14
# target: aarch64-unknown-linux-gnu
# - rust: '1.69' # LLVM 15
# target: aarch64-unknown-linux-gnu
# - rust: stable
# target: aarch64-unknown-linux-gnu
# - rust: beta
# target: aarch64-unknown-linux-gnu
# - rust: nightly
# target: aarch64-unknown-linux-gnu
# # TODO: compiler-builtins bug https://github.com/rust-lang/compiler-builtins/pull/539
# - rust: nightly-2023-05-12
# target: aarch64_be-unknown-linux-gnu
# - rust: stable
# target: aarch64-unknown-linux-musl
# - rust: stable
# target: aarch64-unknown-linux-musl
# flags: -C target-feature=-crt-static
# - rust: nightly
# target: aarch64-unknown-linux-musl
# - rust: nightly
# target: aarch64-unknown-linux-musl
# flags: -C target-feature=-crt-static
# - rust: stable
# target: aarch64-linux-android
# - rust: nightly
# target: aarch64-linux-android
# - rust: stable
# target: armv5te-unknown-linux-gnueabi
# - rust: nightly
# target: armv5te-unknown-linux-gnueabi
# - rust: nightly
# target: arm-unknown-linux-gnueabi
# - rust: nightly
# target: armv7-unknown-linux-gnueabi
- rust: nightly
target: armv7-unknown-linux-gnueabihf
- rust: nightly
target: armeb-unknown-linux-gnueabi
# - rust: nightly
# target: arm-linux-androideabi
# - rust: nightly
# target: i586-unknown-linux-gnu
# - rust: nightly
# target: i686-unknown-linux-gnu
# - rust: nightly
# target: loongarch64-unknown-linux-gnu
# - rust: nightly
# target: mips-unknown-linux-gnu
# - rust: nightly
# target: mipsel-unknown-linux-gnu
# - rust: nightly
# target: mips64-unknown-linux-gnuabi64
# - rust: nightly
# target: mips64el-unknown-linux-gnuabi64
# - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet
# target: mipsisa32r6-unknown-linux-gnu
# - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet
# target: mipsisa32r6el-unknown-linux-gnu
# - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet
# target: mipsisa64r6-unknown-linux-gnuabi64
# - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet
# target: mipsisa64r6el-unknown-linux-gnuabi64
# - rust: nightly
# target: powerpc-unknown-linux-gnu
# - rust: nightly
# target: powerpc64-unknown-linux-gnu
# # - rust: nightly-2023-03-26 # Rust 1.70, LLVM 16
# # target: powerpc64-unknown-linux-gnu
# - rust: nightly-2023-03-25 # Rust 1.70, LLVM 15
# target: powerpc64-unknown-linux-gnu
# # - rust: nightly-2022-08-13 # Rust 1.65, LLVM 15
# # target: powerpc64-unknown-linux-gnu
# - rust: nightly-2022-08-12 # Rust 1.65, LLVM 14
# target: powerpc64-unknown-linux-gnu
# # - rust: nightly-2022-02-18 # Rust 1.60, LLVM 14
# # target: powerpc64-unknown-linux-gnu
# # - rust: nightly-2022-02-17 # Rust 1.60, LLVM 13
# # target: powerpc64-unknown-linux-gnu
# - rust: nightly-2022-02-13 # Rust 1.60, LLVM 13 (oldest version we can use asm_experimental_arch on this target)
# target: powerpc64-unknown-linux-gnu
# - rust: nightly
# target: powerpc64le-unknown-linux-gnu
# # - rust: nightly-2023-03-26 # Rust 1.70, LLVM 16
# # target: powerpc64le-unknown-linux-gnu
# - rust: nightly-2023-03-25 # Rust 1.70, LLVM 15
# target: powerpc64le-unknown-linux-gnu
# # - rust: nightly-2022-08-13 # Rust 1.65, LLVM 15
# # target: powerpc64le-unknown-linux-gnu
# - rust: nightly-2022-08-12 # Rust 1.65, LLVM 14
# target: powerpc64le-unknown-linux-gnu
# # - rust: nightly-2022-02-18 # Rust 1.60, LLVM 14
# # target: powerpc64le-unknown-linux-gnu
# # - rust: nightly-2022-02-17 # Rust 1.60, LLVM 13
# # target: powerpc64le-unknown-linux-gnu
# - rust: nightly-2022-02-13 # Rust 1.60, LLVM 13 (oldest version we can use asm_experimental_arch on this target)
# target: powerpc64le-unknown-linux-gnu
# - rust: nightly
# target: riscv32gc-unknown-linux-gnu
# - rust: nightly
# target: riscv64gc-unknown-linux-gnu
# - rust: nightly
# target: s390x-unknown-linux-gnu
# - rust: nightly-2023-05-09 # Rust 1.71, LLVM 16 (oldest version we can use asm_experimental_arch on this target)
# target: s390x-unknown-linux-gnu
# - rust: nightly
# target: sparc64-unknown-linux-gnu
# - rust: nightly
# target: thumbv7neon-unknown-linux-gnueabihf
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- 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')
- run: |
C:/msys64/usr/bin/pacman -S --noconfirm moreutils
if: startsWith(matrix.os, 'windows')
- name: Install Rust
run: rustup toolchain add ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- run: rustup toolchain add nightly --no-self-update
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-minimal-versions
- uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-careful
if: startsWith(matrix.rust, 'nightly')
- uses: taiki-e/setup-cross-toolchain-action@v1 #more # TODO: back to @v1
with:
target: ${{ matrix.target }}
if: matrix.target != ''
- run: echo "RUSTFLAGS=${RUSTFLAGS} --cfg qemu" >>"${GITHUB_ENV}"
if: matrix.target != '' && !startsWith(matrix.target, 'i686') && !startsWith(matrix.target, 'x86_64')
- run: |
echo "RUSTFLAGS=${RUSTFLAGS} ${{ matrix.flags }}" >>"${GITHUB_ENV}"
echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} ${{ matrix.flags }}" >>"${GITHUB_ENV}"
if: matrix.flags != ''
- run: echo "TARGET=--target=${{ matrix.target }}" >>"${GITHUB_ENV}"
if: matrix.target != ''
- run: tools/test.sh -vv $TARGET $DOCTEST_XCOMPILE $BUILD_STD
# We test doctest only once with the default build conditions because doctest is slow. Both api-test
# and src/tests have extended copies of doctest, so this will not reduce test coverage.
- run: tools/test.sh -vv --tests $TARGET $DOCTEST_XCOMPILE $BUILD_STD
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_no_outline_atomics
RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_no_outline_atomics
# outline-atomics is disabled by default on aarch64 musl with static linking
if: (matrix.target == '' && !contains(matrix.rust, 'i686') || startsWith(matrix.target, 'x86_64')) || startsWith(matrix.target, 'aarch64') && !(contains(matrix.target, '-musl') && matrix.flags == '') || startsWith(matrix.target, 'armv5te') || matrix.target == 'arm-linux-androideabi'
- run: tools/test.sh -vv --tests $TARGET $DOCTEST_XCOMPILE $BUILD_STD
env:
# Note: detect_false cfg is intended to make it easy for portable-atomic developers to
# test cases such as has_cmpxchg16b == false, has_lse == false,
# __kuser_helper_version < 5, etc., and is not a public API.
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_test_outline_atomics_detect_false
RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_test_outline_atomics_detect_false
# outline-atomics is disabled by default on aarch64 musl with static linking
if: (matrix.target == '' && !contains(matrix.rust, 'i686') || startsWith(matrix.target, 'x86_64')) || startsWith(matrix.target, 'aarch64') && !(contains(matrix.target, '-musl') && matrix.flags == '') || startsWith(matrix.target, 'armv5te') || matrix.target == 'arm-linux-androideabi'
# outline-atomics is disabled by default on aarch64 musl with static linking and powerpc64
# powerpc64le- (little-endian) is skipped because it is pwr8 by default
- run: tools/test.sh -vv --tests $TARGET $DOCTEST_XCOMPILE $BUILD_STD
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_outline_atomics
RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_outline_atomics
if: startsWith(matrix.target, 'aarch64') && contains(matrix.target, '-musl') && matrix.flags == '' || startsWith(matrix.target, 'powerpc64-')
- run: tools/test.sh -vv --tests $TARGET $DOCTEST_XCOMPILE $BUILD_STD
env:
# Note: detect_false cfg is intended to make it easy for portable-atomic developers to
# test cases such as has_cmpxchg16b == false, has_lse == false,
# __kuser_helper_version < 5, etc., and is not a public API.
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_outline_atomics --cfg portable_atomic_test_outline_atomics_detect_false
RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_outline_atomics --cfg portable_atomic_test_outline_atomics_detect_false
if: startsWith(matrix.target, 'aarch64') && contains(matrix.target, '-musl') && matrix.flags == '' || startsWith(matrix.target, 'powerpc64-')
# +cmpxchg16b
- run: tools/test.sh -vv --tests $TARGET $DOCTEST_XCOMPILE $BUILD_STD
env:
# cmpxchg16b + outline-atomics (vmovdqa load/store) path is tested in first 2 runs on macOS.
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics
if: (matrix.target == '' && !contains(matrix.rust, 'i686') || startsWith(matrix.target, 'x86_64'))
# +lse
# As of QEMU 8.0, QEMU has not yet implemented FEAT_LSE2: https://linaro.atlassian.net/browse/QEMU-300
# FEAT_LSE2 is tested on Cirrus CI's aarch64 macOS VM.
- run: tools/test.sh -vv --tests $TARGET $DOCTEST_XCOMPILE $BUILD_STD
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse
if: startsWith(matrix.target, 'aarch64')
# pwr7
# powerpc64- (big-endian) is skipped because it is pre-pwr8 by default
- run: tools/test.sh -vv --tests $TARGET $DOCTEST_XCOMPILE $BUILD_STD
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=pwr7
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=pwr7
if: startsWith(matrix.target, 'powerpc64le-')
# pwr8
# powerpc64le- (little-endian) is skipped because it is pwr8 by default
- run: tools/test.sh -vv --tests $TARGET $DOCTEST_XCOMPILE $BUILD_STD
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=pwr8
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=pwr8
if: startsWith(matrix.target, 'powerpc64-')
# z196 (arch9)
- run: tools/test.sh -vv --tests $TARGET $DOCTEST_XCOMPILE $BUILD_STD
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=z196
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=z196
if: startsWith(matrix.target, 's390x')
# z15 (arch13)
- run: tools/test.sh -vv --tests $TARGET $DOCTEST_XCOMPILE $BUILD_STD
env:
# TODO: disable high-word LLVM target-feature to avoid LLVM codegen bug.
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=z15 -C target-feature=-high-word
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=z15 -C target-feature=-high-word
if: startsWith(matrix.target, 's390x')
- run: tools/build.sh ${{ matrix.target || 'host' }}
- run: TESTS=1 tools/build.sh ${{ matrix.target || 'host' }}
- run: cargo minimal-versions build -vvv --workspace --features $TEST_FEATURES --ignore-unknown-features --ignore-private $TARGET $BUILD_STD
# TODO: LLVM bug: Undefined temporary symbol error when building std.
if: matrix.target != 'mips-unknown-linux-gnu' && matrix.target != 'mipsel-unknown-linux-gnu'
- run: cargo minimal-versions build -vvv --release --workspace --features $TEST_FEATURES --ignore-unknown-features --ignore-private $TARGET $BUILD_STD
if: matrix.target == 'mips-unknown-linux-gnu' || matrix.target == 'mipsel-unknown-linux-gnu'
# build:
# needs: tidy
# name: build (${{ matrix.name || matrix.rust }})
# strategy:
# fail-fast: false
# matrix:
# include:
# - rust: '1.34'
# - rust: '1.59'
# - rust: stable
# - rust: beta
# - rust: nightly
# # The oldest nightly that can compile this crate is nightly-2019-01-27
# # which Atomic{I,U}{8,16,32,64} stabilized.
# # https://github.com/rust-lang/rust/pull/57425
# # Note: Old nightly compilers are essentially fragile, so support for
# # them is on a best-effort basis.
# - rust: nightly-2019-01-27
# # https://github.com/taiki-e/portable-atomic/pull/52
# - rust: nightly-2020-06-21
# # for AVR: https://github.com/rust-lang/compiler-builtins/issues/400
# - rust: nightly-2020-12-26
# # Check that test suite can be built
# - name: nightly, --tests
# rust: nightly
# tests: 1
# # Check that this crate can be built for all builtin targets
# - name: stable, all tier1/tier2
# rust: stable
# target-group: tier1/tier2
# - name: nightly, all tier1/tier2
# rust: nightly
# target-group: tier1/tier2
# - name: nightly, all tier3
# rust: nightly
# target-group: tier3
# runs-on: ubuntu-latest
# timeout-minutes: 120 # TODO
# steps:
# - uses: actions/checkout@v3
# with:
# persist-credentials: false
# - name: Install Rust
# run: rustup toolchain add ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
# - uses: taiki-e/install-action@cargo-hack
# - uses: taiki-e/install-action@cargo-no-dev-deps
# - run: tools/build.sh
# env:
# TESTS: ${{ matrix.tests }}
# TARGET_GROUP: ${{ matrix.target-group }}
# no-std:
# needs: tidy
# runs-on: ubuntu-latest
# timeout-minutes: 60
# steps:
# - uses: actions/checkout@v3
# with:
# persist-credentials: false
# - name: Install Rust
# run: rustup toolchain add nightly --no-self-update && rustup default nightly
# - uses: taiki-e/install-action@cargo-hack
# - uses: taiki-e/install-action@v2
# with:
# tool: espup
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - run: |
# set -euxo pipefail
# 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 \
# avr-libc \
# gcc-avr \
# qemu-system-arm \
# qemu-system-misc \
# simavr
# # APT's qemu package doesn't provide firmware for riscv32: https://packages.ubuntu.com/en/jammy/all/qemu-system-data/filelist
# OPENSBI_VERSION=1.2
# 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"
# - run: espup install
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - run: tools/no-std.sh
# - run: tools/build.sh +esp xtensa-esp32-none-elf
# - run: tools/no-std.sh +esp xtensa-esp32-none-elf
# miri:
# needs: tidy
# strategy:
# fail-fast: false
# matrix:
# include:
# - target: x86_64-unknown-linux-gnu
# - target: x86_64-unknown-linux-gnu
# flags: -C target-feature=+cmpxchg16b
# - target: aarch64-unknown-linux-gnu
# - target: i686-unknown-linux-gnu
# - target: powerpc64le-unknown-linux-gnu
# - target: s390x-unknown-linux-gnu
# runs-on: ubuntu-latest
# timeout-minutes: 60
# steps:
# - uses: actions/checkout@v3
# with:
# persist-credentials: false
# - name: Install Rust
# run: rustup toolchain add nightly --no-self-update --component miri && rustup default 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
# - run: echo "TARGET=--target=${{ matrix.target }}" >>"${GITHUB_ENV}"
# if: matrix.target != 'x86_64-unknown-linux-gnu'
# - run: tools/test.sh miri $TARGET
# env:
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} ${{ matrix.flags }}
# RUSTFLAGS: ${{ env.RUSTFLAGS }} ${{ matrix.flags }}
# san:
# needs: tidy
# strategy:
# fail-fast: false
# matrix:
# sanitizer:
# - address
# - memory
# - thread
# runs-on: ubuntu-latest
# timeout-minutes: 60
# steps:
# - uses: actions/checkout@v3
# with:
# persist-credentials: false
# - name: Install Rust
# run: rustup toolchain add nightly --no-self-update && rustup default 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
# - run: |
# echo "ASAN_OPTIONS=detect_stack_use_after_return=1" >>"${GITHUB_ENV}"
# echo "RUSTFLAGS=${RUSTFLAGS} -Z sanitizer=address" >>"${GITHUB_ENV}"
# echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} -Z sanitizer=address" >>"${GITHUB_ENV}"
# if: matrix.sanitizer == 'address'
# - run: |
# echo "MSAN_OPTIONS=verbosity=2" >>"${GITHUB_ENV}"
# echo "RUSTFLAGS=${RUSTFLAGS} -Z sanitizer=memory -Z sanitizer-memory-track-origins" >>"${GITHUB_ENV}"
# echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} -Z sanitizer=memory -Z sanitizer-memory-track-origins" >>"${GITHUB_ENV}"
# if: matrix.sanitizer == 'memory'
# - run: |
# echo "RUSTFLAGS=${RUSTFLAGS} -Z sanitizer=thread" >>"${GITHUB_ENV}"
# echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} -Z sanitizer=thread" >>"${GITHUB_ENV}"
# if: matrix.sanitizer == 'thread'
# - run: tools/test.sh -Z build-std
# # We test doctest only once with the default build conditions because doctest is slow. Both api-test
# # and src/tests have extended copies of doctest, so this will not reduce test coverage.
# # +cmpxchg16b
# - run: tools/test.sh -Z build-std -vv --tests
# env:
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics
# valgrind:
# needs: tidy
# runs-on: ubuntu-latest
# timeout-minutes: 60
# steps:
# - uses: actions/checkout@v3
# with:
# persist-credentials: false
# - name: Install Rust
# run: rustup toolchain add nightly --no-self-update && rustup default 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
# # We test doctest only once with the default build conditions because doctest is slow. Both api-test
# # and src/tests have extended copies of doctest, so this will not reduce test coverage.
# # +cmpxchg16b
# - run: tools/test.sh valgrind -vv --tests
# env:
# # vmovdqa load/store path has been tested above, disable outline-atomics and test cmpxchg16b load/store path.
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics
# codegen:
# needs: tidy
# runs-on: ubuntu-latest
# timeout-minutes: 60
# permissions:
# contents: write
# pull-requests: write
# steps:
# - uses: actions/checkout@v3
# with:
# persist-credentials: false
# - name: Install Rust
# run: rustup toolchain add nightly --no-self-update --component rustfmt && rustup default nightly
# - run: tools/no_atomic.sh
# - run: tools/gen.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')
# - uses: peter-evans/create-pull-request@v5
# with:
# title: Update generated code
# body: |
# Auto-generated by [create-pull-request][1]
# [Please close and immediately reopen this pull request to run CI.][2]
# [1]: https://github.com/peter-evans/create-pull-request
# [2]: https://github.com/peter-evans/create-pull-request/blob/HEAD/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
# branch: update-generated-code
# 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