-
Notifications
You must be signed in to change notification settings - Fork 470
240 lines (222 loc) · 6.98 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
name: CI
permissions:
contents: read
on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 1 * * *'
env:
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
# Test crates on their minimum Rust versions and nightly Rust.
test:
env:
RUST_VERSION: ${{ matrix.rust }}
RUST_TARGET: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
# aarch64/x86_64 macOS and aarch64 Linux are tested on Cirrus CI
include:
- rust: '1.61'
os: ubuntu-latest
- rust: '1.61'
os: windows-latest
- rust: stable
os: ubuntu-latest
- rust: stable
os: windows-latest
- rust: nightly
os: ubuntu-latest
- rust: nightly
os: windows-latest
- rust: nightly
os: ubuntu-latest
target: i686-unknown-linux-gnu
- rust: nightly
os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
# Test 32-bit target that does not have AtomicU64/AtomicI64.
- rust: nightly
os: ubuntu-latest
target: armv5te-unknown-linux-gnueabi
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
if: matrix.target != ''
- name: Test
run: ci/test.sh
# Check all feature combinations works properly.
features:
env:
RUST_VERSION: ${{ matrix.rust }}
strategy:
fail-fast: false
matrix:
rust:
- msrv
- nightly
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
if: matrix.rust != 'msrv'
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Check features
run: ci/check-features.sh
# Check for duplicate dependencies.
dependencies:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Install cargo-minimal-versions
uses: taiki-e/install-action@cargo-minimal-versions
- name: dependency tree check
run: ci/dependencies.sh
# When this job failed, run ci/no_atomic.sh and commit result changes.
codegen:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup update stable
- run: ci/no_atomic.sh
- run: git add -N . && git diff --exit-code
if: github.repository_owner != 'crossbeam-rs' || github.event_name != 'schedule'
- id: diff
run: |
git config user.name "Taiki Endo"
git config user.email "[email protected]"
git add -N .
if ! git diff --exit-code; then
git add .
git commit -m "Update no_atomic.rs"
echo "::set-output name=success::false"
fi
if: github.repository_owner == 'crossbeam-rs' && github.event_name == 'schedule'
- uses: peter-evans/create-pull-request@v5
with:
title: Update no_atomic.rs
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-no-atomic-rs
if: github.repository_owner == 'crossbeam-rs' && github.event_name == 'schedule' && steps.diff.outputs.success == 'false'
# Check formatting.
rustfmt:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup update stable
- name: rustfmt
run: cargo fmt --all --check
# Check clippy.
clippy:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup update stable
- name: clippy
run: cargo clippy --all --tests --examples
# Run miri.
miri:
runs-on: ubuntu-latest
timeout-minutes: 120 # TODO
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup toolchain install nightly --component miri && rustup default nightly
- name: miri
run: ci/miri.sh
# Run cargo-careful.
careful:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup toolchain install nightly --component rust-src && rustup default nightly
- uses: taiki-e/install-action@cargo-careful
- name: Run cargo-careful
run: ci/careful.sh
# Run sanitizers.
san:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup update nightly && 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
- name: Run sanitizers
run: ci/san.sh
# Run loom tests.
loom:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup update stable
- name: loom
run: ci/crossbeam-epoch-loom.sh
# Check if the document can be generated without warning.
docs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: docs
run: cargo doc --no-deps --all --all-features
shellcheck:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install shellcheck
uses: taiki-e/install-action@shellcheck
- run: shellcheck $(git ls-files '*.sh')