Skip to content

Commit 762c95d

Browse files
committed
Move from actions-rs/toolchain to dtolnay/rust-toolchain
The current action we are using is unmantained: actions-rs/toolchain#216 This replacement is faster, smaller, and more cachable. We can also completely remove the toolchain step when testing with cross, as cross handles configuration of its own toolchain. Signed-off-by: Joe Richey <joerichey@google.com>
1 parent 52a4c3c commit 762c95d

File tree

1 file changed

+16
-58
lines changed

1 file changed

+16
-58
lines changed

.github/workflows/tests.yml

Lines changed: 16 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- 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
21+
- uses: dtolnay/rust-toolchain@nightly # Needed for -Z minimal-versions and doc_cfg
2622
- uses: Swatinem/rust-cache@v1
2723
- name: Install precompiled cargo-deadlinks
2824
run: |
@@ -51,11 +47,9 @@ jobs:
5147
toolchain: stable
5248
steps:
5349
- uses: actions/checkout@v2
54-
- uses: actions-rs/toolchain@v1
50+
- uses: dtolnay/rust-toolchain@master
5551
with:
56-
profile: minimal
5752
toolchain: ${{ matrix.toolchain }}
58-
override: true
5953
- uses: Swatinem/rust-cache@v1
6054
- run: cargo test
6155
- run: cargo test --features=std
@@ -75,11 +69,9 @@ jobs:
7569
]
7670
steps:
7771
- uses: actions/checkout@v2
78-
- uses: actions-rs/toolchain@v1
72+
- uses: dtolnay/rust-toolchain@stable
7973
with:
80-
profile: minimal
81-
target: ${{ matrix.target }}
82-
toolchain: stable
74+
targets: ${{ matrix.target }}
8375
- uses: Swatinem/rust-cache@v1
8476
- name: Install multilib
8577
# update is needed to fix the 404 error on install, see:
@@ -103,11 +95,9 @@ jobs:
10395
]
10496
steps:
10597
- uses: actions/checkout@v2
106-
- uses: actions-rs/toolchain@v1
98+
- uses: dtolnay/rust-toolchain@stable
10799
with:
108-
profile: minimal
109-
target: ${{ matrix.target }}
110-
toolchain: stable
100+
targets: x86_64-apple-ios
111101
- uses: Swatinem/rust-cache@v1
112102
- name: Build Tests
113103
run: cargo test --no-run --target=${{ matrix.target }} --features=std
@@ -124,12 +114,9 @@ jobs:
124114
]
125115
steps:
126116
- uses: actions/checkout@v2
127-
- name: Install toolchain
128-
uses: actions-rs/toolchain@v1
117+
- uses: dtolnay/rust-toolchain@master
129118
with:
130-
profile: minimal
131119
toolchain: ${{ matrix.toolchain }}
132-
override: true
133120
- uses: Swatinem/rust-cache@v1
134121
- run: cargo test --features=std
135122

@@ -146,11 +133,6 @@ jobs:
146133
]
147134
steps:
148135
- uses: actions/checkout@v2
149-
- uses: actions-rs/toolchain@v1
150-
with:
151-
profile: minimal
152-
target: ${{ matrix.target }}
153-
toolchain: stable
154136
- uses: Swatinem/rust-cache@v1
155137
- name: Install precompiled cross
156138
run: |
@@ -174,11 +156,6 @@ jobs:
174156
]
175157
steps:
176158
- uses: actions/checkout@v2
177-
- uses: actions-rs/toolchain@v1
178-
with:
179-
profile: minimal
180-
target: ${{ matrix.target }}
181-
toolchain: stable
182159
- uses: Swatinem/rust-cache@v1
183160
- name: Install precompiled cross
184161
run: |
@@ -194,11 +171,9 @@ jobs:
194171
runs-on: ubuntu-latest
195172
steps:
196173
- uses: actions/checkout@v2
197-
- uses: actions-rs/toolchain@v1
174+
- uses: dtolnay/rust-toolchain@stable
198175
with:
199-
profile: minimal
200-
target: wasm32-unknown-unknown
201-
toolchain: stable
176+
targets: wasm32-unknown-unknown
202177
- uses: Swatinem/rust-cache@v1
203178
- name: Install precompiled wasm-bindgen-test-runner
204179
run: |
@@ -224,12 +199,9 @@ jobs:
224199
runs-on: ubuntu-latest
225200
steps:
226201
- uses: actions/checkout@v2
227-
- uses: actions-rs/toolchain@v1
202+
- uses: dtolnay/rust-toolchain@nightly # Need to build libstd
228203
with:
229-
profile: minimal
230-
toolchain: nightly
231204
components: rust-src
232-
override: true
233205
- uses: Swatinem/rust-cache@v1
234206
- name: Build and Link tests (build-std)
235207
# This target is Tier 3, so we have to build libstd ourselves.
@@ -242,11 +214,9 @@ jobs:
242214
runs-on: ubuntu-latest
243215
steps:
244216
- uses: actions/checkout@v2
245-
- uses: actions-rs/toolchain@v1
217+
- uses: dtolnay/rust-toolchain@stable
246218
with:
247-
profile: minimal
248-
target: wasm32-wasi
249-
toolchain: stable
219+
targets: wasm32-wasi
250220
- uses: Swatinem/rust-cache@v1
251221
- name: Install precompiled wasmtime
252222
run: |
@@ -268,12 +238,9 @@ jobs:
268238
]
269239
steps:
270240
- uses: actions/checkout@v2
271-
- uses: actions-rs/toolchain@v1
241+
- uses: dtolnay/rust-toolchain@stable
272242
with:
273-
profile: minimal
274-
target: ${{ matrix.target }}
275-
toolchain: stable
276-
override: true
243+
targets: ${{ matrix.target }}
277244
- uses: Swatinem/rust-cache@v1
278245
- name: Build
279246
run: cargo build --target=${{ matrix.target }} --features=std
@@ -283,13 +250,9 @@ jobs:
283250
runs-on: ubuntu-latest
284251
steps:
285252
- uses: actions/checkout@v2
286-
- name: Install toolchain
287-
uses: actions-rs/toolchain@v1
253+
- uses: dtolnay/rust-toolchain@nightly # Required to build libcore
288254
with:
289-
profile: minimal
290-
toolchain: nightly # Required to build libcore
291255
components: rust-src
292-
override: true
293256
- uses: Swatinem/rust-cache@v1
294257
- name: Hermit (x86-64 only)
295258
run: cargo build -Z build-std=core --target=x86_64-unknown-hermit
@@ -317,14 +280,9 @@ jobs:
317280
runs-on: ubuntu-latest
318281
steps:
319282
- uses: actions/checkout@v1
320-
- uses: actions-rs/toolchain@v1
283+
- uses: dtolnay/rust-toolchain@stable
321284
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
326285
components: rustfmt, clippy
327-
override: true
328286
- uses: Swatinem/rust-cache@v1
329287
- name: clippy
330288
run: cargo clippy --all --features=custom,std

0 commit comments

Comments
 (0)