@@ -48,34 +48,18 @@ jobs:
4848 steps :
4949 - uses : actions/checkout@v2
5050
51- - name : set cache name
52- id : vars
53- # The cache tag consists of the following parts:
54- # * test-deps-bazel-cache- prefix
55- # * hash of WORKSPACE, .bazelrc, and .bazelversion, which is
56- # purely to differentiate caches for substantial changes in bazel.
57- # * github.sha, which is the commit hash of the commit used to generate
58- # the cache entry.
59- run : echo "CACHE_TAG=test-deps-bazel-cache-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion') }}" >> "$GITHUB_OUTPUT"
60-
61- - name : bazel cache
62- uses : actions/cache/restore@v3
51+ -
uses :
bazel-contrib/[email protected] 6352 with :
64- path : /tmp/bazel/cache
65- key : ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
66- restore-keys : |
67- ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
68- ${{ steps.vars.outputs.CACHE_TAG }}-
69- test-deps-bazel-cache-${{ matrix.name }}-
70- test-deps-bazel-cache-
53+ bazelisk-cache : true
54+ disk-cache : ${{ github.job }}
55+ repository-cache : true
7156
7257 - name : Bazel build
7358 run : >
7459 bazel build
7560 --verbose_failures
7661 --test_output=errors
7762 --config=clang
78- --disk_cache /tmp/bazel/cache
7963 --config=hermetic-llvm
8064 -c opt
8165 $(bazel query 'kind(was.*_rust_binary, //test/test_data/...)')
@@ -100,22 +84,6 @@ jobs:
10084 if-no-files-found : error
10185 retention-days : 3
10286
103- - name : remove unaccessed files from cache
104- shell : bash
105- run : >
106- find /tmp/bazel/cache
107- -type f
108- -name '*'
109- -amin +360
110- -exec rm {} \;
111-
112- - name : save bazel cache
113- uses : actions/cache/save@v3
114- if : always()
115- with :
116- path : /tmp/bazel/cache
117- key : ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
118-
11987 build :
12088 name : ${{ matrix.action }} with ${{ matrix.name }}
12189
@@ -304,27 +272,11 @@ jobs:
304272 if : startsWith(matrix.run_under, 'docker')
305273 run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
306274
307- - name : set cache name
308- id : vars
309- # The cache tag consists of the following parts:
310- # * bazel-cache- prefix
311- # * matrix.name, which separates the cache for each build type.
312- # * hash of WORKSPACE, .bazelrc, and .bazelversion, which is
313- # purely to differentiate caches for substantial changes in bazel.
314- # * github.sha, which is the commit hash of the commit used to generate
315- # the cache entry.
316- run : echo "CACHE_TAG=bazel-cache-${{ matrix.name }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion') }}" >> "$GITHUB_OUTPUT"
317-
318- - name : bazel cache
319- uses : actions/cache/restore@v3
275+ -
uses :
bazel-contrib/[email protected] 320276 with :
321- path : /tmp/bazel/cache
322- key : ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
323- restore-keys : |
324- ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
325- ${{ steps.vars.outputs.CACHE_TAG }}-
326- bazel-cache-${{ matrix.name }}-
327- bazel-cache-
277+ bazelisk-cache : true
278+ disk-cache : ${{ github.job }}-${{ matrix.name }}
279+ repository-cache : true
328280
329281 - name : Download test data
330282 uses : actions/download-artifact@v4
@@ -349,7 +301,6 @@ jobs:
349301 --verbose_failures
350302 --test_output=errors
351303 --define engine=${{ matrix.engine }}
352- --disk_cache /tmp/bazel/cache
353304 ${{ matrix.flags }}
354305 -- //test/... ${{ matrix.targets }}
355306
@@ -361,24 +312,7 @@ jobs:
361312 --verbose_failures
362313 --test_output=errors
363314 --define engine=${{ matrix.engine }}
364- --disk_cache /tmp/bazel/cache
365315 ${{ matrix.flags }}
366316 --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 -c3- | tr -d '\n')\"
367317 //test:signature_util_test
368318
369- - name : remove unaccessed files from cache
370- shell : bash
371- run : >
372- find /tmp/bazel/cache
373- -type f
374- -name '*'
375- -amin +360
376- -exec rm {} \;
377-
378- - name : save bazel cache
379- uses : actions/cache/save@v3
380- if : always()
381- with :
382- path : /tmp/bazel/cache
383- key : ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
384-
0 commit comments