Skip to content

Commit ff95ea1

Browse files
authored
Make caching GitHub actions use separate caches (#35)
A follow-up to #34 Once cache is formed, it's not updated anymore (see actions/toolkit#505). As such, it doesn't make sense having the cache shared between unrelated actions. Made each action using a cache key tied to its tool.
1 parent 9513a3a commit ff95ea1

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

.github/workflows/coverage-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ jobs:
9797
~/.cargo/registry/cache/
9898
~/.cargo/git/db/
9999
target/
100-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
101-
restore-keys: ${{ runner.os }}-cargo-
100+
key: ${{ runner.os }}-cargo-llvm-cov-${{ hashFiles('**/Cargo.lock') }}
101+
restore-keys: ${{ runner.os }}-cargo-llvm-cov
102102

103103
- name: Install cargo-llvm-cov (fallback path)
104104
if: ${{ steps.base_art.outputs.found == 'false' }}

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
~/.cargo/registry/cache/
2626
~/.cargo/git/db/
2727
target/
28-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
29-
restore-keys: ${{ runner.os }}-cargo-
28+
key: ${{ runner.os }}-cargo-llvm-cov-${{ hashFiles('**/Cargo.lock') }}
29+
restore-keys: ${{ runner.os }}-cargo-llvm-cov
3030

3131
- run: which cargo-llvm-cov || cargo install cargo-llvm-cov
3232
- run: rustup component add llvm-tools-preview

.github/workflows/dependency-audit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
~/.cargo/registry/cache/
3333
~/.cargo/git/db/
3434
target/
35-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
36-
restore-keys: ${{ runner.os }}-cargo-
35+
key: ${{ runner.os }}-cargo-deny-${{ hashFiles('**/Cargo.lock') }}
36+
restore-keys: ${{ runner.os }}-cargo-deny
3737

3838
- name: Run audit-check action
3939
run: |

.github/workflows/semver-checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
~/.cargo/registry/index/
3434
~/.cargo/registry/cache/
3535
~/.cargo/git/db/
36-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
36+
key: ${{ runner.os }}-cargo-semver-checks-${{ hashFiles('**/Cargo.lock') }}
3737
restore-keys: |
38-
${{ runner.os }}-cargo-
38+
${{ runner.os }}-cargo-semver-checks
3939
4040
- name: Get latest version tag
4141
id: get-baseline
@@ -79,4 +79,4 @@ jobs:
7979
echo "3. Future changes will be checked against tagged versions"
8080
echo ""
8181
echo "Note: Semver checking starts from v0.1.0 as this indicates"
82-
echo "the beginning of API stability commitments in Rust projects"
82+
echo "the beginning of API stability commitments in Rust projects"

0 commit comments

Comments
 (0)