From c39e0484f76bbc061dfd92dcf1beafe8c6c9edac Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Thu, 16 Jul 2020 13:15:46 -0400 Subject: [PATCH] Cache by rustc hash --- .github/workflows/build_test.yml | 7 +++++-- .github/workflows/deploy.yml | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index a8ea308..8bffa87 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -27,6 +27,7 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 + id: cargo with: toolchain: stable components: clippy @@ -36,7 +37,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-rust-check-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-rust-${{ steps.cargo.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}-lint - name: Run cargo check run: cargo check - name: Run clippy @@ -47,14 +48,16 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 + id: cargo with: toolchain: stable + components: clippy - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-rust-debug-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-rust-${{ steps.cargo.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}-debug-build - name: Run cargo test run: cargo test diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 282ea1c..94a0a57 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,15 +11,17 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 + id: cargo with: toolchain: stable + components: clippy - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-rust-release-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-rust-${{ steps.cargo.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}-release-build - name: Build release run: cargo build --release - name: Upload compiled binary artifact