Skip to content

Commit 07ff992

Browse files
committed
Use hash of Cargo.lock file in cache name
1 parent f6434f1 commit 07ff992

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

.github/workflows/clippy.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@ jobs:
3737
toolchain: nightly
3838
target: x86_64-unknown-linux-gnu
3939
profile: minimal
40+
- name: Checkout
41+
uses: actions/checkout@v2.0.0
42+
- name: Run cargo update
43+
run: cargo update
4044
- name: Cache cargo dir
4145
uses: actions/cache@v1
4246
with:
4347
path: ~/.cargo
44-
key: ${{ runner.os }}-x86_64-unknown-linux-gnu
45-
- name: Checkout
46-
uses: actions/checkout@v2.0.0
48+
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-${{ hashFiles('Cargo.lock') }}
49+
restore-keys: |
50+
${{ runner.os }}-x86_64-unknown-linux-gnu
4751
- name: Master Toolchain Setup
4852
run: bash setup-toolchain.sh
4953

.github/workflows/clippy_bors.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,17 @@ jobs:
8585
toolchain: nightly
8686
target: ${{ matrix.host }}
8787
profile: minimal
88+
- name: Checkout
89+
uses: actions/checkout@v2.0.0
90+
- name: Run cargo update
91+
run: cargo update
8892
- name: Cache cargo dir
8993
uses: actions/cache@v1
9094
with:
9195
path: ~/.cargo
92-
key: ${{ runner.os }}-${{ matrix.host }}
93-
- name: Checkout
94-
uses: actions/checkout@v2.0.0
96+
key: ${{ runner.os }}-${{ matrix.host }}-${{ hashFiles('Cargo.lock') }}
97+
restore-keys: |
98+
${{ runner.os }}-${{ matrix.host }}
9599
- name: Master Toolchain Setup
96100
run: bash setup-toolchain.sh
97101
env:
@@ -163,13 +167,17 @@ jobs:
163167
toolchain: nightly
164168
target: x86_64-unknown-linux-gnu
165169
profile: minimal
170+
- name: Checkout
171+
uses: actions/checkout@v2.0.0
172+
- name: Run cargo update
173+
run: cargo update
166174
- name: Cache cargo dir
167175
uses: actions/cache@v1
168176
with:
169177
path: ~/.cargo
170-
key: ${{ runner.os }}-x86_64-unknown-linux-gnu
171-
- name: Checkout
172-
uses: actions/checkout@v2.0.0
178+
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-${{ hashFiles('Cargo.lock') }}
179+
restore-keys: |
180+
${{ runner.os }}-x86_64-unknown-linux-gnu
173181
- name: Master Toolchain Setup
174182
run: bash setup-toolchain.sh
175183

@@ -226,13 +234,17 @@ jobs:
226234
toolchain: nightly
227235
target: x86_64-unknown-linux-gnu
228236
profile: minimal
237+
- name: Checkout
238+
uses: actions/checkout@v2.0.0
239+
- name: Run cargo update
240+
run: cargo update
229241
- name: Cache cargo dir
230242
uses: actions/cache@v1
231243
with:
232244
path: ~/.cargo
233-
key: ${{ runner.os }}-x86_64-unknown-linux-gnu
234-
- name: Checkout
235-
uses: actions/checkout@v2.0.0
245+
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-${{ hashFiles('Cargo.lock') }}
246+
restore-keys: |
247+
${{ runner.os }}-x86_64-unknown-linux-gnu
236248
- name: Master Toolchain Setup
237249
run: bash setup-toolchain.sh
238250

0 commit comments

Comments
 (0)