Skip to content

Commit

Permalink
ci: set cache key to include rustc_hash (fixes #180)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Dec 28, 2020
1 parent 65e28bf commit b643804
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Rust nightly
id: toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -26,12 +27,13 @@ jobs:
- name: Cache cargo build
uses: actions/cache@v1
env:
cache-name: cargo-build-target-2
cache-name: cargo-build-target
with:
path: target
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
# key needs to contain rustc_hash due to https://github.com/ActivityWatch/aw-server-rust/issues/180
key: ${{ runner.os }}-${{ env.cache-name }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
${{ runner.os }}-${{ env.cache-name }}-${{ steps.toolchain.outputs.rustc_hash }}-
- name: Build
run: cargo build --workspace --verbose
- name: Run tests
Expand Down

0 comments on commit b643804

Please sign in to comment.