-
-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (154 loc) · 6.07 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
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
# NB: sync with miri job's --exclude option
EXCLUDE: --exclude asm-test
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/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
miri:
uses: taiki-e/github-actions/.github/workflows/miri.yml@main
with:
# NB: sync with env.EXCLUDE
args: --exclude asm-test
all-features: false
msrv:
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
test:
strategy:
fail-fast: false
matrix:
include:
- rust: stable
- rust: beta
- rust: nightly
- rust: nightly
target: aarch64-unknown-linux-gnu
- rust: nightly
target: armv5te-unknown-linux-gnueabi
- rust: nightly
target: i686-unknown-linux-gnu
- rust: nightly
target: s390x-unknown-linux-gnu
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- 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/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: echo "TARGET=--target=${{ matrix.target }}" >>"${GITHUB_ENV}"
if: matrix.target != ''
- run: cargo test -v --workspace $EXCLUDE $DOCTEST_XCOMPILE
- run: cargo test -v --workspace $EXCLUDE --release $DOCTEST_XCOMPILE
- run: cargo test -v --workspace $EXCLUDE --release $DOCTEST_XCOMPILE
env:
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
CARGO_PROFILE_RELEASE_LTO: fat
- run: cargo careful test -v --workspace $EXCLUDE $TARGET $DOCTEST_XCOMPILE
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -Z randomize-layout
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout
if: startsWith(matrix.rust, 'nightly')
- run: cargo hack build -vv --workspace --no-private --feature-powerset --optional-deps --no-dev-deps
- run: tools/build.sh
if: matrix.target == ''
- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features
- run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features --direct
san:
strategy:
fail-fast: false
matrix:
sanitizer:
- address
- memory
- thread
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup toolchain add nightly --no-self-update --component rust-src && rustup default nightly
# https://github.com/google/sanitizers/issues/1716 / https://github.com/actions/runner-images/issues/9491
- run: sudo sysctl vm.mmap_rnd_bits=28
- 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: |
cargo -Z build-std test --workspace $EXCLUDE --target "$(rustc -vV | grep '^host:' | cut -d' ' -f2)"
- run: |
cargo -Z build-std test --workspace $EXCLUDE --release --target "$(rustc -vV | grep '^host:' | cut -d' ' -f2)"
- run: |
cargo -Z build-std test --workspace $EXCLUDE --release --target "$(rustc -vV | grep '^host:' | cut -d' ' -f2)"
env:
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
CARGO_PROFILE_RELEASE_LTO: fat
valgrind:
env:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: valgrind -v --error-exitcode=1 --error-limit=no --leak-check=full --show-leak-kinds=all --track-origins=yes --fair-sched=yes
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup toolchain add nightly --no-self-update && rustup default nightly
- uses: taiki-e/install-action@valgrind
# -Z doctest-xcompile is needed to apply CARGO_TARGET_*_RUNNER to doctest.
- run: cargo test -v --workspace $EXCLUDE -Z doctest-xcompile
- run: cargo test -v --workspace $EXCLUDE --release -Z doctest-xcompile
- run: cargo test -v --workspace $EXCLUDE --release -Z doctest-xcompile
env:
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
CARGO_PROFILE_RELEASE_LTO: fat