Skip to content

Commit b643804

Browse files
committed
ci: set cache key to include rustc_hash (fixes #180)
1 parent 65e28bf commit b643804

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/build.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v2
2020
- name: Set up Rust nightly
21+
id: toolchain
2122
uses: actions-rs/toolchain@v1
2223
with:
2324
profile: minimal
@@ -26,12 +27,13 @@ jobs:
2627
- name: Cache cargo build
2728
uses: actions/cache@v1
2829
env:
29-
cache-name: cargo-build-target-2
30+
cache-name: cargo-build-target
3031
with:
3132
path: target
32-
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
33+
# key needs to contain rustc_hash due to https://github.com/ActivityWatch/aw-server-rust/issues/180
34+
key: ${{ runner.os }}-${{ env.cache-name }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
3335
restore-keys: |
34-
${{ runner.os }}-${{ env.cache-name }}-
36+
${{ runner.os }}-${{ env.cache-name }}-${{ steps.toolchain.outputs.rustc_hash }}-
3537
- name: Build
3638
run: cargo build --workspace --verbose
3739
- name: Run tests

0 commit comments

Comments
 (0)