Skip to content

Commit b35add2

Browse files
committed
Uptade to Swatinem/rust-cache@v2
Also move the cache step to be right before we start running cargo commands. Signed-off-by: Joe Richey <[email protected]>
1 parent a91ad48 commit b35add2

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.github/workflows/tests.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v3
2121
- uses: dtolnay/rust-toolchain@nightly # Needed for -Z minimal-versions and doc_cfg
22-
- uses: Swatinem/rust-cache@v1
2322
- name: Install precompiled cargo-deadlinks
2423
run: |
2524
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')
2625
wget -O /tmp/cargo-deadlinks $URL
2726
chmod +x /tmp/cargo-deadlinks
2827
mv /tmp/cargo-deadlinks ~/.cargo/bin
28+
- uses: Swatinem/rust-cache@v2
2929
- name: Generate Docs
3030
env:
3131
RUSTDOCFLAGS: --cfg docsrs
@@ -51,7 +51,7 @@ jobs:
5151
- uses: dtolnay/rust-toolchain@master
5252
with:
5353
toolchain: ${{ matrix.toolchain }}
54-
- uses: Swatinem/rust-cache@v1
54+
- uses: Swatinem/rust-cache@v2
5555
- run: cargo test
5656
- run: cargo test --features=std
5757
- run: cargo test --features=custom # custom should do nothing here
@@ -73,13 +73,13 @@ jobs:
7373
- uses: dtolnay/rust-toolchain@stable
7474
with:
7575
targets: ${{ matrix.target }}
76-
- uses: Swatinem/rust-cache@v1
7776
- name: Install multilib
7877
# update is needed to fix the 404 error on install, see:
7978
# https://github.com/actions/virtual-environments/issues/675
8079
run: |
8180
sudo apt-get update
8281
sudo apt-get install gcc-multilib
82+
- uses: Swatinem/rust-cache@v2
8383
- run: cargo test --target=${{ matrix.target }} --features=std
8484

8585
ios-tests:
@@ -90,7 +90,6 @@ jobs:
9090
- uses: dtolnay/rust-toolchain@stable
9191
with:
9292
targets: x86_64-apple-ios
93-
- uses: Swatinem/rust-cache@v1
9493
- name: Download cargo-dinghy
9594
run: |
9695
VERSION=0.6.2
@@ -103,6 +102,7 @@ jobs:
103102
SIM_ID=$(xcrun simctl create My-iphone7 com.apple.CoreSimulator.SimDeviceType.iPhone-7 $RUNTIME_ID)
104103
xcrun simctl boot $SIM_ID
105104
echo "device=$SIM_ID" >> $GITHUB_ENV
105+
- uses: Swatinem/rust-cache@v2
106106
- name: Run tests
107107
run: cargo dinghy -d ${{ env.device }} test
108108

@@ -121,7 +121,7 @@ jobs:
121121
- uses: dtolnay/rust-toolchain@master
122122
with:
123123
toolchain: ${{ matrix.toolchain }}
124-
- uses: Swatinem/rust-cache@v1
124+
- uses: Swatinem/rust-cache@v2
125125
- run: cargo test --features=std
126126

127127
cross-tests:
@@ -137,13 +137,13 @@ jobs:
137137
]
138138
steps:
139139
- uses: actions/checkout@v3
140-
- uses: Swatinem/rust-cache@v1
141140
- name: Install precompiled cross
142141
run: |
143142
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')
144143
wget -O /tmp/binaries.tar.gz $URL
145144
tar -C /tmp -xzf /tmp/binaries.tar.gz
146145
mv /tmp/cross ~/.cargo/bin
146+
- uses: Swatinem/rust-cache@v2
147147
- name: Test
148148
run: cross test --no-fail-fast --target=${{ matrix.target }} --features=std
149149

@@ -155,7 +155,7 @@ jobs:
155155
- uses: dtolnay/rust-toolchain@stable
156156
with:
157157
targets: aarch64-apple-darwin, aarch64-apple-ios
158-
- uses: Swatinem/rust-cache@v1
158+
- uses: Swatinem/rust-cache@v2
159159
- run: cargo test --no-run --target=aarch64-apple-darwin --features=std
160160
- run: cargo test --no-run --target=aarch64-apple-ios --features=std
161161

@@ -172,13 +172,13 @@ jobs:
172172
]
173173
steps:
174174
- uses: actions/checkout@v3
175-
- uses: Swatinem/rust-cache@v1
176175
- name: Install precompiled cross
177176
run: |
178177
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')
179178
wget -O /tmp/binaries.tar.gz $URL
180179
tar -C /tmp -xzf /tmp/binaries.tar.gz
181180
mv /tmp/cross ~/.cargo/bin
181+
- uses: Swatinem/rust-cache@v2
182182
- name: Build Tests
183183
run: cross test --no-run --target=${{ matrix.target }} --features=std
184184

@@ -190,13 +190,13 @@ jobs:
190190
- uses: dtolnay/rust-toolchain@stable
191191
with:
192192
targets: wasm32-unknown-unknown
193-
- uses: Swatinem/rust-cache@v1
194193
- name: Install precompiled wasm-bindgen-test-runner
195194
run: |
196195
export VERSION=$(cargo metadata --format-version=1 | jq -r '.packages[] | select ( .name == "wasm-bindgen" ) | .version')
197196
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
198197
tar -C /tmp -xzf /tmp/binaries.tar.gz --strip-components=1
199198
mv /tmp/wasm-bindgen-test-runner ~/.cargo/bin
199+
- uses: Swatinem/rust-cache@v2
200200
- name: Test (Node)
201201
run: cargo test --target=wasm32-unknown-unknown --features=js
202202
- name: Test (Firefox)
@@ -218,7 +218,7 @@ jobs:
218218
- uses: dtolnay/rust-toolchain@nightly # Need to build libstd
219219
with:
220220
components: rust-src
221-
- uses: Swatinem/rust-cache@v1
221+
- uses: Swatinem/rust-cache@v2
222222
- name: Build and Link tests (build-std)
223223
# This target is Tier 3, so we have to build libstd ourselves.
224224
# We currently cannot run these tests because wasm-bindgen-test-runner
@@ -233,13 +233,13 @@ jobs:
233233
- uses: dtolnay/rust-toolchain@stable
234234
with:
235235
targets: wasm32-wasi
236-
- uses: Swatinem/rust-cache@v1
237236
- name: Install precompiled wasmtime
238237
run: |
239238
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')
240239
wget -O /tmp/binaries.tar.xz $URL
241240
tar -C /tmp -xf /tmp/binaries.tar.xz --strip-components=1
242241
mv /tmp/wasmtime ~/.cargo/bin
242+
- uses: Swatinem/rust-cache@v2
243243
- run: cargo test --target wasm32-wasi
244244

245245
build-tier2:
@@ -257,7 +257,7 @@ jobs:
257257
- uses: dtolnay/rust-toolchain@stable
258258
with:
259259
targets: ${{ matrix.target }}
260-
- uses: Swatinem/rust-cache@v1
260+
- uses: Swatinem/rust-cache@v2
261261
- name: Build
262262
run: cargo build --target=${{ matrix.target }} --features=std
263263

@@ -269,7 +269,7 @@ jobs:
269269
- uses: dtolnay/rust-toolchain@nightly # Required to build libcore
270270
with:
271271
components: rust-src
272-
- uses: Swatinem/rust-cache@v1
272+
- uses: Swatinem/rust-cache@v2
273273
- name: Hermit (x86-64 only)
274274
run: cargo build -Z build-std=core --target=x86_64-unknown-hermit
275275
- name: UEFI (RDRAND)
@@ -299,7 +299,7 @@ jobs:
299299
- uses: dtolnay/rust-toolchain@stable
300300
with:
301301
components: rustfmt, clippy
302-
- uses: Swatinem/rust-cache@v1
302+
- uses: Swatinem/rust-cache@v2
303303
- name: clippy
304304
run: cargo clippy --all --features=custom,std
305305
- name: fmt

0 commit comments

Comments
 (0)