Update cargo target dir caching

As rustc always rebuilds artifacts between each rustc relases
This commit is contained in:
lzutao 2020-04-25 23:33:17 +07:00 committed by GitHub
parent f00dedfa6c
commit dadeeb9467
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -388,11 +388,16 @@ When dependencies are installed later in the workflow, we must specify the same
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Get rustc commit hash
id: cargo-target-cache
run: |
echo "::set-output name=rust_hash::$(rustc -Vv | grep commit-hash | awk '{print $2}')"
shell: bash
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-cargo-build-target-${{ steps.cargo-target-cache.outputs.rust_hash }}-${{ hashFiles('**/Cargo.lock') }}
```
## Scala - SBT