Skip to content

Commit cbc2dd9

Browse files
authored
workflows: remove unaccessed files from cache before saving (#452)
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 <mattleon@google.com>
1 parent 4fbf312 commit cbc2dd9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ jobs:
9999
if-no-files-found: error
100100
retention-days: 3
101101

102+
- name: remove unaccessed files from cache
103+
shell: bash
104+
run: >
105+
find /tmp/bazel/cache
106+
-type f
107+
-name '*'
108+
-amin +360
109+
-exec rm {} \;
110+
102111
- name: save bazel cache
103112
uses: actions/cache/save@v3
104113
if: always()
@@ -352,6 +361,15 @@ jobs:
352361
--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-)\"
353362
//test:signature_util_test
354363
364+
- name: remove unaccessed files from cache
365+
shell: bash
366+
run: >
367+
find /tmp/bazel/cache
368+
-type f
369+
-name '*'
370+
-amin +360
371+
-exec rm {} \;
372+
355373
- name: save bazel cache
356374
uses: actions/cache/save@v3
357375
if: always()

0 commit comments

Comments
 (0)