@@ -17,19 +17,15 @@ jobs:
17
17
name : Docs, deadlinks, minimal dependencies
18
18
runs-on : ubuntu-latest
19
19
steps :
20
- - uses : actions/checkout@v2
21
- - uses : actions-rs/toolchain@v1
22
- with :
23
- profile : minimal
24
- toolchain : nightly # Needed for -Z minimal-versions and doc_cfg
25
- override : true
26
- - uses : Swatinem/rust-cache@v1
20
+ - uses : actions/checkout@v3
21
+ - uses : dtolnay/rust-toolchain@nightly # Needed for -Z minimal-versions and doc_cfg
27
22
- name : Install precompiled cargo-deadlinks
28
23
run : |
29
24
export URL=$(curl -s https://api.github.com/repos/deadlinks/cargo-deadlinks/releases/latest | jq -r '.assets[] | select(.name | contains("cargo-deadlinks-linux")) | .browser_download_url')
30
25
wget -O /tmp/cargo-deadlinks $URL
31
26
chmod +x /tmp/cargo-deadlinks
32
27
mv /tmp/cargo-deadlinks ~/.cargo/bin
28
+ - uses : Swatinem/rust-cache@v2
33
29
- name : Generate Docs
34
30
env :
35
31
RUSTDOCFLAGS : --cfg docsrs
38
34
cargo generate-lockfile -Z minimal-versions
39
35
cargo test --features=custom,std
40
36
37
+ # TODO: add aarch64-based macOS runner when it's supported by Github Actions
41
38
main-tests :
42
- name : Main tests
39
+ name : Tier 1 Test
43
40
runs-on : ${{ matrix.os }}
44
41
strategy :
45
42
matrix :
@@ -50,21 +47,19 @@ jobs:
50
47
- os : macos-latest
51
48
toolchain : stable
52
49
steps :
53
- - uses : actions/checkout@v2
54
- - uses : actions-rs/ toolchain@v1
50
+ - uses : actions/checkout@v3
51
+ - uses : dtolnay/rust- toolchain@master
55
52
with :
56
- profile : minimal
57
53
toolchain : ${{ matrix.toolchain }}
58
- override : true
59
- - uses : Swatinem/rust-cache@v1
54
+ - uses : Swatinem/rust-cache@v2
60
55
- run : cargo test
61
56
- run : cargo test --features=std
62
57
- run : cargo test --features=custom # custom should do nothing here
63
58
- if : ${{ matrix.toolchain == 'nightly' }}
64
59
run : cargo test --benches
65
60
66
61
linux-tests :
67
- name : Additional Linux targets
62
+ name : Linux Test
68
63
runs-on : ubuntu-latest
69
64
strategy :
70
65
matrix :
@@ -74,46 +69,45 @@ jobs:
74
69
i686-unknown-linux-musl,
75
70
]
76
71
steps :
77
- - uses : actions/checkout@v2
78
- - uses : actions-rs/ toolchain@v1
72
+ - uses : actions/checkout@v3
73
+ - uses : dtolnay/rust- toolchain@stable
79
74
with :
80
- profile : minimal
81
- target : ${{ matrix.target }}
82
- toolchain : stable
83
- - uses : Swatinem/rust-cache@v1
75
+ targets : ${{ matrix.target }}
84
76
- name : Install multilib
85
77
# update is needed to fix the 404 error on install, see:
86
78
# https://github.com/actions/virtual-environments/issues/675
87
79
run : |
88
80
sudo apt-get update
89
81
sudo apt-get install gcc-multilib
82
+ - uses : Swatinem/rust-cache@v2
90
83
- run : cargo test --target=${{ matrix.target }} --features=std
91
84
92
- # We can only Build/Link on these targets for now.
93
- # TODO: Run the iOS binaries in the simulator
94
- # TODO: build/run aarch64-apple-darwin binaries on a x86_64 Mac
95
- apple-tests :
96
- name : Additional Apple targets
85
+ ios-tests :
86
+ name : iOS Simulator Test
97
87
runs-on : macos-latest
98
- strategy :
99
- matrix :
100
- target : [
101
- aarch64-apple-ios,
102
- x86_64-apple-ios,
103
- ]
104
88
steps :
105
- - uses : actions/checkout@v2
106
- - uses : actions-rs/ toolchain@v1
89
+ - uses : actions/checkout@v3
90
+ - uses : dtolnay/rust- toolchain@stable
107
91
with :
108
- profile : minimal
109
- target : ${{ matrix.target }}
110
- toolchain : stable
111
- - uses : Swatinem/rust-cache@v1
112
- - name : Build Tests
113
- run : cargo test --no-run --target=${{ matrix.target }} --features=std
92
+ targets : x86_64-apple-ios
93
+ - name : Download cargo-dinghy
94
+ run : |
95
+ VERSION=0.6.2
96
+ URL="https://github.com/sonos/dinghy/releases/download/${VERSION}/cargo-dinghy-macos-${VERSION}.tgz"
97
+ curl -L $URL | tar -xz --strip-components=1 -C ~/.cargo/bin
98
+ cargo dinghy --version
99
+ - name : Setup Simulator
100
+ run : |
101
+ RUNTIME_ID=$(xcrun simctl list runtimes | grep iOS | cut -d ' ' -f 7 | tail -1)
102
+ SIM_ID=$(xcrun simctl create My-iphone7 com.apple.CoreSimulator.SimDeviceType.iPhone-7 $RUNTIME_ID)
103
+ xcrun simctl boot $SIM_ID
104
+ echo "device=$SIM_ID" >> $GITHUB_ENV
105
+ - uses : Swatinem/rust-cache@v2
106
+ - name : Run tests
107
+ run : cargo dinghy -d ${{ env.device }} test
114
108
115
109
windows-tests :
116
- name : Additional Windows targets
110
+ name : Windows Test
117
111
runs-on : windows-latest
118
112
strategy :
119
113
matrix :
@@ -123,14 +117,11 @@ jobs:
123
117
stable-i686-msvc,
124
118
]
125
119
steps :
126
- - uses : actions/checkout@v2
127
- - name : Install toolchain
128
- uses : actions-rs/toolchain@v1
120
+ - uses : actions/checkout@v3
121
+ - uses : dtolnay/rust-toolchain@master
129
122
with :
130
- profile : minimal
131
123
toolchain : ${{ matrix.toolchain }}
132
- override : true
133
- - uses : Swatinem/rust-cache@v1
124
+ - uses : Swatinem/rust-cache@v2
134
125
- run : cargo test --features=std
135
126
136
127
cross-tests :
@@ -145,22 +136,29 @@ jobs:
145
136
wasm32-unknown-emscripten,
146
137
]
147
138
steps :
148
- - uses : actions/checkout@v2
149
- - uses : actions-rs/toolchain@v1
150
- with :
151
- profile : minimal
152
- target : ${{ matrix.target }}
153
- toolchain : stable
154
- - uses : Swatinem/rust-cache@v1
139
+ - uses : actions/checkout@v3
155
140
- name : Install precompiled cross
156
141
run : |
157
142
export URL=$(curl -s https://api.github.com/repos/cross-rs/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
158
143
wget -O /tmp/binaries.tar.gz $URL
159
144
tar -C /tmp -xzf /tmp/binaries.tar.gz
160
145
mv /tmp/cross ~/.cargo/bin
146
+ - uses : Swatinem/rust-cache@v2
161
147
- name : Test
162
148
run : cross test --no-fail-fast --target=${{ matrix.target }} --features=std
163
149
150
+ macos-link :
151
+ name : macOS ARM64 Build/Link
152
+ runs-on : macos-latest
153
+ steps :
154
+ - uses : actions/checkout@v3
155
+ - uses : dtolnay/rust-toolchain@stable
156
+ with :
157
+ targets : aarch64-apple-darwin, aarch64-apple-ios
158
+ - uses : Swatinem/rust-cache@v2
159
+ - run : cargo test --no-run --target=aarch64-apple-darwin --features=std
160
+ - run : cargo test --no-run --target=aarch64-apple-ios --features=std
161
+
164
162
cross-link :
165
163
name : Cross Build/Link
166
164
runs-on : ubuntu-latest
@@ -173,39 +171,32 @@ jobs:
173
171
x86_64-unknown-netbsd,
174
172
]
175
173
steps :
176
- - uses : actions/checkout@v2
177
- - uses : actions-rs/toolchain@v1
178
- with :
179
- profile : minimal
180
- target : ${{ matrix.target }}
181
- toolchain : stable
182
- - uses : Swatinem/rust-cache@v1
174
+ - uses : actions/checkout@v3
183
175
- name : Install precompiled cross
184
176
run : |
185
177
export URL=$(curl -s https://api.github.com/repos/cross-rs/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
186
178
wget -O /tmp/binaries.tar.gz $URL
187
179
tar -C /tmp -xzf /tmp/binaries.tar.gz
188
180
mv /tmp/cross ~/.cargo/bin
181
+ - uses : Swatinem/rust-cache@v2
189
182
- name : Build Tests
190
183
run : cross test --no-run --target=${{ matrix.target }} --features=std
191
184
192
185
web-tests :
193
- name : Web tests
186
+ name : Web Test
194
187
runs-on : ubuntu-latest
195
188
steps :
196
- - uses : actions/checkout@v2
197
- - uses : actions-rs/ toolchain@v1
189
+ - uses : actions/checkout@v3
190
+ - uses : dtolnay/rust- toolchain@stable
198
191
with :
199
- profile : minimal
200
- target : wasm32-unknown-unknown
201
- toolchain : stable
202
- - uses : Swatinem/rust-cache@v1
192
+ targets : wasm32-unknown-unknown
203
193
- name : Install precompiled wasm-bindgen-test-runner
204
194
run : |
205
195
export VERSION=$(cargo metadata --format-version=1 | jq -r '.packages[] | select ( .name == "wasm-bindgen" ) | .version')
206
196
wget -O /tmp/binaries.tar.gz https://github.com/rustwasm/wasm-bindgen/releases/download/$VERSION/wasm-bindgen-$VERSION-x86_64-unknown-linux-musl.tar.gz
207
197
tar -C /tmp -xzf /tmp/binaries.tar.gz --strip-components=1
208
198
mv /tmp/wasm-bindgen-test-runner ~/.cargo/bin
199
+ - uses : Swatinem/rust-cache@v2
209
200
- name : Test (Node)
210
201
run : cargo test --target=wasm32-unknown-unknown --features=js
211
202
- name : Test (Firefox)
@@ -220,44 +211,39 @@ jobs:
220
211
run : cargo test --target=wasm32-unknown-unknown --features=custom
221
212
222
213
wasm64-tests :
223
- name : WASM memory64
214
+ name : wasm64 Build/Link
224
215
runs-on : ubuntu-latest
225
216
steps :
226
- - uses : actions/checkout@v2
227
- - uses : actions-rs/ toolchain@v1
217
+ - uses : actions/checkout@v3
218
+ - uses : dtolnay/rust- toolchain@nightly # Need to build libstd
228
219
with :
229
- profile : minimal
230
- toolchain : nightly
231
220
components : rust-src
232
- override : true
233
- - uses : Swatinem/rust-cache@v1
221
+ - uses : Swatinem/rust-cache@v2
234
222
- name : Build and Link tests (build-std)
235
223
# This target is Tier 3, so we have to build libstd ourselves.
236
224
# We currently cannot run these tests because wasm-bindgen-test-runner
237
225
# does not yet support memory64.
238
226
run : cargo test --no-run -Z build-std=std,panic_abort --target=wasm64-unknown-unknown --features=js
239
227
240
228
wasi-tests :
241
- name : WASI test
229
+ name : WASI Test
242
230
runs-on : ubuntu-latest
243
231
steps :
244
- - uses : actions/checkout@v2
245
- - uses : actions-rs/ toolchain@v1
232
+ - uses : actions/checkout@v3
233
+ - uses : dtolnay/rust- toolchain@stable
246
234
with :
247
- profile : minimal
248
- target : wasm32-wasi
249
- toolchain : stable
250
- - uses : Swatinem/rust-cache@v1
235
+ targets : wasm32-wasi
251
236
- name : Install precompiled wasmtime
252
237
run : |
253
238
export URL=$(curl -s https://api.github.com/repos/bytecodealliance/wasmtime/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-linux.tar.xz")) | .browser_download_url')
254
239
wget -O /tmp/binaries.tar.xz $URL
255
240
tar -C /tmp -xf /tmp/binaries.tar.xz --strip-components=1
256
241
mv /tmp/wasmtime ~/.cargo/bin
242
+ - uses : Swatinem/rust-cache@v2
257
243
- run : cargo test --target wasm32-wasi
258
244
259
- build :
260
- name : Build only
245
+ build-tier2 :
246
+ name : Tier 2 Build
261
247
runs-on : ubuntu-latest
262
248
strategy :
263
249
matrix :
@@ -267,65 +253,57 @@ jobs:
267
253
x86_64-fortanix-unknown-sgx,
268
254
]
269
255
steps :
270
- - uses : actions/checkout@v2
271
- - uses : actions-rs/ toolchain@v1
256
+ - uses : actions/checkout@v3
257
+ - uses : dtolnay/rust- toolchain@stable
272
258
with :
273
- profile : minimal
274
- target : ${{ matrix.target }}
275
- toolchain : stable
276
- override : true
277
- - uses : Swatinem/rust-cache@v1
259
+ targets : ${{ matrix.target }}
260
+ - uses : Swatinem/rust-cache@v2
278
261
- name : Build
279
262
run : cargo build --target=${{ matrix.target }} --features=std
280
263
281
- build-std :
282
- name : Build-only (build-std)
264
+ build-tier3 :
265
+ name : Tier 3 Build
283
266
runs-on : ubuntu-latest
267
+ strategy :
268
+ matrix :
269
+ # Supported tier 3 targets without libstd support
270
+ target : [
271
+ x86_64-unknown-hermit,
272
+ x86_64-wrs-vxworks,
273
+ aarch64-kmc-solid_asp3,
274
+ armv6k-nintendo-3ds,
275
+ riscv32imc-esp-espidf,
276
+ ]
277
+ include :
278
+ # Supported tier 3 targets without libstd support
279
+ - target : x86_64-unknown-openbsd
280
+ features : ["std"]
281
+ - target : x86_64-unknown-dragonfly
282
+ features : ["std"]
283
+ - target : x86_64-unknown-haiku
284
+ features : ["std"]
285
+ # Unsupported tier 3 targets to test the rdrand feature
286
+ - target : x86_64-unknown-uefi
287
+ features : ["rdrand"]
288
+ - target : x86_64-unknown-l4re-uclibc
289
+ features : ["rdrand"]
284
290
steps :
285
- - uses : actions/checkout@v2
286
- - name : Install toolchain
287
- uses : actions-rs/toolchain@v1
291
+ - uses : actions/checkout@v3
292
+ - uses : dtolnay/rust-toolchain@nightly # Required to build libcore
288
293
with :
289
- profile : minimal
290
- toolchain : nightly # Required to build libcore
291
294
components : rust-src
292
- override : true
293
- - uses : Swatinem/rust-cache@v1
294
- - name : Hermit (x86-64 only)
295
- run : cargo build -Z build-std=core --target=x86_64-unknown-hermit
296
- - name : UEFI (RDRAND)
297
- run : cargo build -Z build-std=core --features=rdrand --target=x86_64-unknown-uefi
298
- - name : L4Re (RDRAND)
299
- run : cargo build -Z build-std=core --features=rdrand --target=x86_64-unknown-l4re-uclibc
300
- - name : VxWorks
301
- run : cargo build -Z build-std=core --target=x86_64-wrs-vxworks
302
- - name : SOLID
303
- run : cargo build -Z build-std=core --target=aarch64-kmc-solid_asp3
304
- - name : Nintendo 3DS
305
- run : cargo build -Z build-std=core --target=armv6k-nintendo-3ds
306
- - name : RISC-V ESP-IDF
307
- run : cargo build -Z build-std=core --target=riscv32imc-esp-espidf
308
- - name : OpenBSD
309
- run : cargo build -Z build-std=std --target=x86_64-unknown-openbsd --features=std
310
- - name : Dragonfly BSD
311
- run : cargo build -Z build-std=std --target=x86_64-unknown-dragonfly --features=std
312
- - name : Haiku OS
313
- run : cargo build -Z build-std=std --target=x86_64-unknown-haiku --features=std
295
+ - uses : Swatinem/rust-cache@v2
296
+ - run : cargo build -Z build-std=${{ contains(matrix.features, 'std') && 'std' || 'core'}} --target=${{ matrix.target }} --features="${{ join(matrix.features, ',') }}"
314
297
315
298
clippy-fmt :
316
299
name : Clippy + rustfmt
317
300
runs-on : ubuntu-latest
318
301
steps :
319
302
- uses : actions/checkout@v1
320
- - uses : actions-rs/ toolchain@v1
303
+ - uses : dtolnay/rust- toolchain@stable
321
304
with :
322
- profile : minimal
323
- # https://github.com/rust-lang/rust-clippy/pull/6379 added MSRV
324
- # support, so we need to use nightly until this is on stable.
325
- toolchain : nightly
326
305
components : rustfmt, clippy
327
- override : true
328
- - uses : Swatinem/rust-cache@v1
306
+ - uses : Swatinem/rust-cache@v2
329
307
- name : clippy
330
308
run : cargo clippy --all --features=custom,std
331
309
- name : fmt
0 commit comments