CI: Include rustc version in key for `target/` cache
@@ -150,16 +150,6 @@ jobs:
${{ runner.os }}-cargo-git-db-${{ matrix.rust }}-
${{ runner.os }}-cargo-git-db-
- # Current size as of 2019-12-23: ~336 MB
- - name: Cache cargo build
- uses: actions/cache@v1
- with:
- path: target
- key: ${{ runner.os }}-cargo-build-target-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
- restore-key: |
- ${{ runner.os }}-cargo-build-target-${{ matrix.rust }}-
- ${{ runner.os }}-cargo-build-target-
-
- name: Install ${{ matrix.rust }} Rust
run: |
if [[ ! -d "$HOME/.cargo" || ! -d "$HOME/.rustup" ]]; then
@@ -176,6 +166,19 @@ jobs:
rustup component add rustfmt
rustup component add clippy
+ - id: rustc
+ run:
+ echo "::set-output name=version::$(rustc -V)"
+
+ # Current size as of 2019-12-23: ~336 MB
+ - name: Cache cargo build
+ uses: actions/cache@v1
+ with:
+ path: target
+ key: ${{ runner.os }}-cargo-build-target-${{ steps.rustc.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
+ restore-key: |
+ ${{ runner.os }}-cargo-build-target-${{ steps.rustc.outputs.version }}-
+
- name: Cargo clean on new rustc version
run: script/ci/cargo-clean-on-new-rustc-version.sh
