From 4c9454aa9e16dc1d681b31d00cfb3591953906b9 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Mon, 23 Nov 2020 14:19:11 +0100 Subject: [PATCH] Use different cache keys per pipeline --- .github/workflows/audit.yml | 17 +++++++---------- .github/workflows/release.yml | 2 +- .github/workflows/rust.yml | 6 +++--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index a8fadb2..a771eb5 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -14,17 +14,14 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Cache cargo registry - uses: actions/cache@v1 + - name: Cache cargo registry, index and build directory + uses: actions/cache@v2 with: - path: /usr/share/rust/.cargo/registry - key: ${{ runner.os }}-cargo-registry - - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: /usr/share/rust/.cargo/git - key: ${{ runner.os }}-cargo-index + path: | + ~/.cargo/registry + ~/.cargo/git + ./target + key: audit-${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - uses: actions-rs/audit-check@v1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fa8846..727fce2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: ~/.cargo/registry ~/.cargo/git ./target - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + key: release-${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - name: Cargo build uses: actions-rs/cargo@v1 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d672392..a363293 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,7 +24,7 @@ jobs: ~/.cargo/registry ~/.cargo/git ./target - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + key: rustfmt-${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - name: Check Formatting uses: actions-rs/cargo@v1 @@ -54,7 +54,7 @@ jobs: ~/.cargo/registry ~/.cargo/git ./target - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + key: clippy-${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - name: Clippy Linting uses: actions-rs/cargo@v1 @@ -89,7 +89,7 @@ jobs: ~/.cargo/registry ~/.cargo/git ./target - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + key: test-${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - name: Run Tests uses: actions-rs/cargo@v1