@@ -22,31 +22,23 @@ jobs:
2222 continue-on-error : ${{ matrix.rust == 'nightly' }}
2323
2424 steps :
25- - uses : actions/checkout@v2
25+ - uses : actions/checkout@v3
2626
2727 - name : Restore cargo cache
28- uses : actions/ cache@v2
28+ uses : Swatinem/rust- cache@v2
2929 env :
3030 cache-name : ci
3131 with :
32- path : |
33- ~/.cargo/registry
34- ~/.cargo/git
35- ~/.cargo/bin
36- target
37- key : ${{ matrix.os }}-${{ env.cache-name }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
32+ shared-key : ${{ matrix.os }}-${{ env.cache-name }}-${{ matrix.rust }}
3833
3934 - name : MacOS Workaround
4035 if : matrix.os == 'macos-latest'
4136 run : cargo clean -p serde_derive -p thiserror
4237
4338 - name : Install Rust
44- uses : actions-rs/ toolchain@v1
39+ uses : dtolnay/rust- toolchain@stable
4540 with :
4641 toolchain : ${{ matrix.rust }}
47- default : true
48- override : true
49- profile : minimal
5042 components : clippy
5143
5244 - name : Build Debug
@@ -97,15 +89,25 @@ jobs:
9789 rust : [nightly, stable, '1.65']
9890 continue-on-error : ${{ matrix.rust == 'nightly' }}
9991 steps :
100- - uses : actions/checkout@master
92+ - uses : actions/checkout@v3
93+
94+ - name : Restore cargo cache
95+ uses : Swatinem/rust-cache@v2
96+ env :
97+ cache-name : ci
98+ with :
99+ key : ubuntu-latest-${{ env.cache-name }}-${{ matrix.rust }}
100+
101101 - name : Install Rust
102- uses : actions-rs/ toolchain@v1
102+ uses : dtolnay/rust- toolchain@stable
103103 with :
104104 toolchain : ${{ matrix.rust }}
105- profile : minimal
106- default : true
107- override : true
108- target : x86_64-unknown-linux-musl
105+ targets : x86_64-unknown-linux-musl
106+
107+ # The build would fail without manually installing the target.
108+ # https://github.com/dtolnay/rust-toolchain/issues/83
109+ - name : Manually install target
110+ run : rustup target add x86_64-unknown-linux-musl
109111
110112 - name : Setup MUSL
111113 run : |
@@ -133,14 +135,19 @@ jobs:
133135 rust : [nightly, stable, '1.65']
134136 continue-on-error : ${{ matrix.rust == 'nightly' }}
135137 steps :
136- - uses : actions/checkout@master
138+ - uses : actions/checkout@v3
139+
140+ - name : Restore cargo cache
141+ uses : Swatinem/rust-cache@v2
142+ env :
143+ cache-name : ci
144+ with :
145+ key : ubuntu-latest-${{ env.cache-name }}-${{ matrix.rust }}
146+
137147 - name : Install Rust
138- uses : actions-rs/ toolchain@v1
148+ uses : dtolnay/rust- toolchain@stable
139149 with :
140150 toolchain : ${{ matrix.rust }}
141- profile : minimal
142- default : true
143- override : true
144151 - name : Setup ARM toolchain
145152 run : |
146153 rustup target add aarch64-unknown-linux-gnu
@@ -168,12 +175,19 @@ jobs:
168175 name : Lints
169176 runs-on : ubuntu-latest
170177 steps :
171- - uses : actions/checkout@master
178+ - uses : actions/checkout@v3
179+
180+ - name : Restore cargo cache
181+ uses : Swatinem/rust-cache@v2
182+ env :
183+ cache-name : ci
184+ with :
185+ key : ubuntu-latest-${{ env.cache-name }}-stable
186+
172187 - name : Install Rust
173- uses : actions-rs/ toolchain@v1
188+ uses : dtolnay/rust- toolchain@stable
174189 with :
175190 toolchain : stable
176- override : true
177191 components : rustfmt
178192
179193 - run : cargo fmt -- --check
@@ -199,12 +213,19 @@ jobs:
199213 name : udeps
200214 runs-on : ubuntu-latest
201215 steps :
202- - uses : actions/checkout@master
216+ - uses : actions/checkout@v3
217+
218+ - name : Restore cargo cache
219+ uses : Swatinem/rust-cache@v2
220+ env :
221+ cache-name : ci
222+ with :
223+ key : ubuntu-latest-${{ env.cache-name }}-nightly
224+
203225 - name : Install Rust
204- uses : actions-rs/ toolchain@v1
226+ uses : dtolnay/rust- toolchain@stable
205227 with :
206228 toolchain : nightly
207- override : true
208229
209230 - name : cargo-udeps
210231 run : |
@@ -217,16 +238,16 @@ jobs:
217238 name : Security audit
218239 runs-on : ubuntu-latest
219240 steps :
220- - uses : actions/checkout@v2
221- - uses : actions-rs /audit-check@v1
241+ - uses : actions/checkout@v3
242+ - uses : rustsec /audit-check@v1.4.1
222243 with :
223244 token : ${{ secrets.GITHUB_TOKEN }}
224245
225246 log-test :
226247 name : Changelog Test
227248 runs-on : ubuntu-latest
228249 steps :
229- - uses : actions/checkout@master
250+ - uses : actions/checkout@v3
230251 - name : Extract release notes
231252 id : extract_release_notes
232253 uses : ffurrer2/extract-release-notes@v1
0 commit comments