From 794014826fcfde4e20bfedf45ecca4affd339eaa Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Thu, 21 Aug 2025 14:14:16 -0400 Subject: [PATCH] workflows: remove unaccessed files from cache before saving Caches are growing organically (started around 400MiB, now at 2+GiB). This strategy is used by github.com/GoogleCloudPlatform/service-extensions to evict unneeded cached entries. Signed-off-by: Matt Leon --- .github/workflows/test.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ec572f3..8c42a546 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -99,6 +99,15 @@ jobs: if-no-files-found: error retention-days: 3 + - name: remove unaccessed files from cache + shell: bash + run: > + find /tmp/bazel/cache + -type f + -name '*' + -amin +360 + -exec rm {} \; + - name: save bazel cache uses: actions/cache/save@v3 if: always() @@ -352,6 +361,15 @@ jobs: --per_file_copt=src/signature_util.cc,test/signature_util_test.cc@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\" //test:signature_util_test + - name: remove unaccessed files from cache + shell: bash + run: > + find /tmp/bazel/cache + -type f + -name '*' + -amin +360 + -exec rm {} \; + - name: save bazel cache uses: actions/cache/save@v3 if: always()