Use different cache keys per pipeline

This commit is contained in:
Valentin Brandl 2020-11-23 14:19:11 +01:00
parent e9e57495a6
commit 4c9454aa9e
3 changed files with 11 additions and 14 deletions

View File

@ -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:

View File

@ -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

View File

@ -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