Skip to content

Commit 681dedc

Browse files
feat: restore similar cache when exact match is missing (#1875)
1 parent 73dcab7 commit 681dedc

File tree

4 files changed

+25
-12
lines changed

4 files changed

+25
-12
lines changed

.github/workflows/component_image.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ jobs:
5757
~/.cargo/registry/cache/
5858
~/.cargo/git/db/
5959
target/
60-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-release
60+
key: ${{ runner.os }}-release-cargo-${{ hashFiles('**/Cargo.lock') }}
61+
restore-keys: ${{ runner.os }}-release-cargo-
6162

6263
- name: Install Zig
6364
uses: mlugg/setup-zig@v2

.github/workflows/component_k8s_e2e.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ jobs:
8383
~/.cargo/registry/cache/
8484
~/.cargo/git/db/
8585
target/
86-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-test-dev
86+
key: ${{ runner.os }}-test-dev-cargo-${{ hashFiles('**/Cargo.lock') }}
87+
restore-keys: ${{ runner.os }}-test-dev-cargo-
8788

8889
- name: Install Zig
8990
uses: mlugg/setup-zig@v2

.github/workflows/component_packages.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ jobs:
6262
~/.cargo/registry/cache/
6363
~/.cargo/git/db/
6464
target/
65-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-release
65+
key: ${{ runner.os }}-release-cargo-${{ hashFiles('**/Cargo.lock') }}
66+
restore-keys: ${{ runner.os }}-release-cargo-
6667

6768
- name: Install Zig
6869
uses: mlugg/setup-zig@v2

.github/workflows/push_pr_checks_tests.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,16 @@ jobs:
6363
toolchain: ${{ env.RUST_VERSION }}
6464
components: clippy
6565

66-
- uses: actions/cache/restore@v4
66+
- uses: actions/cache@v4
6767
with:
6868
path: |
6969
~/.cargo/bin/
7070
~/.cargo/registry/index/
7171
~/.cargo/registry/cache/
7272
~/.cargo/git/db/
7373
target/
74-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-test-dev
74+
key: ${{ runner.os }}-clippy-cargo-${{ hashFiles('**/Cargo.lock') }}
75+
restore-keys: ${{ runner.os }}-clippy-cargo-
7576

7677
- name: cargo clippy with compiler warnings
7778
run: cargo clippy --workspace --all-targets -- -D warnings -D clippy::all
@@ -155,15 +156,16 @@ jobs:
155156
- name: cargo generate-lockfile
156157
if: hashFiles('Cargo.lock') == ''
157158
run: cargo generate-lockfile
158-
- uses: actions/cache/restore@v4
159+
- uses: actions/cache@v4
159160
with:
160161
path: |
161162
~/.cargo/bin/
162163
~/.cargo/registry/index/
163164
~/.cargo/registry/cache/
164165
~/.cargo/git/db/
165166
target/
166-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-test-dev
167+
key: ${{ runner.os }}-coverage-cargo-${{ hashFiles('**/Cargo.lock') }}
168+
restore-keys: ${{ runner.os }}-coverage-cargo-
167169
- name: Generate coverage report
168170
run: COVERAGE_OUT_FORMAT=json COVERAGE_OUT_FILEPATH=jcov.info make coverage
169171
- name: Calculate and print total coverage
@@ -224,7 +226,8 @@ jobs:
224226
~/.cargo/registry/cache/
225227
~/.cargo/git/db/
226228
target/
227-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-release
229+
key: ${{ runner.os }}-release-cargo-${{ hashFiles('**/Cargo.lock') }}
230+
restore-keys: ${{ runner.os }}-release-cargo-
228231

229232
- name: Install Zig
230233
uses: mlugg/setup-zig@v2
@@ -270,7 +273,8 @@ jobs:
270273
~/.cargo/registry/cache/
271274
~/.cargo/git/db/
272275
target/
273-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-test-dev
276+
key: ${{ runner.os }}-test-dev-cargo-${{ hashFiles('**/Cargo.lock') }}
277+
restore-keys: ${{ runner.os }}-test-dev-cargo-
274278

275279
- name: Install Zig
276280
uses: mlugg/setup-zig@v2
@@ -321,7 +325,8 @@ jobs:
321325
~/.cargo/registry/cache/
322326
~/.cargo/git/db/
323327
target/
324-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-test-dev
328+
key: ${{ runner.os }}-test-dev-cargo-${{ hashFiles('**/Cargo.lock') }}
329+
restore-keys: ${{ runner.os }}-test-dev-cargo-
325330

326331
- name: Run onHost root-required integration-tests only
327332
run: make -C agent-control test/onhost/root/integration
@@ -348,6 +353,9 @@ jobs:
348353
steps:
349354
- uses: actions/checkout@v4
350355

356+
- name: Free up space
357+
run: bash .github/workflows/scripts/space_cleanup.sh
358+
351359
- name: Setup Minikube
352360
uses: manusa/actions-setup-minikube@v2.14.0
353361
with:
@@ -380,7 +388,8 @@ jobs:
380388
~/.cargo/registry/cache/
381389
~/.cargo/git/db/
382390
target/
383-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-test-dev
391+
key: ${{ runner.os }}-test-dev-cargo-${{ hashFiles('**/Cargo.lock') }}
392+
restore-keys: ${{ runner.os }}-test-dev-cargo-
384393

385394
- name: Install Zig
386395
uses: mlugg/setup-zig@v2
@@ -437,7 +446,8 @@ jobs:
437446
~/.cargo/registry/cache/
438447
~/.cargo/git/db/
439448
target/
440-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-windows-test-dev
449+
key: ${{ runner.os }}-test-dev-cargo-${{ hashFiles('**/Cargo.lock') }}
450+
restore-keys: ${{ runner.os }}-test-dev-cargo-
441451

442452
- name: Detect unused dependencies
443453
run: cargo shear

0 commit comments

Comments
 (0)