@@ -48,34 +48,20 @@ 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/setup-bazel@0.16.0
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+ external-cache : true
56+ repository-cache : true
7157
7258 - name : Bazel build
7359 run : >
7460 bazel build
7561 --verbose_failures
7662 --test_output=errors
7763 --config=clang
78- --disk_cache /tmp/bazel/cache
64+ --config=hermetic-llvm
7965 -c opt
8066 $(bazel query 'kind(was.*_rust_binary, //test/test_data/...)')
8167 $(bazel query 'kind(_optimized_wasm_cc_binary, //test/test_data/...)')
9985 if-no-files-found : error
10086 retention-days : 3
10187
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-
111- - name : save bazel cache
112- uses : actions/cache/save@v3
113- if : always()
114- with :
115- path : /tmp/bazel/cache
116- key : ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
117-
11888 build :
11989 name : ${{ matrix.action }} with ${{ matrix.name }}
12090
@@ -137,13 +107,13 @@ jobs:
137107 os : ubuntu-24.04-16core
138108 arch : x86_64
139109 action : test
140- flags : --config=clang-asan --define=crypto=system
110+ flags : --config=hermetic-llvm --config= clang-asan --define=crypto=system
141111 - name : ' NullVM on Linux/x86_64 with TSan'
142112 engine : ' null'
143113 os : ubuntu-24.04-16core
144114 arch : x86_64
145115 action : test
146- flags : --config=clang-tsan
116+ flags : --config=hermetic-llvm --config= clang-tsan
147117 - name : ' NullVM on Windows/x86_64'
148118 engine : ' null'
149119 os : windows-2022
@@ -194,67 +164,70 @@ jobs:
194164 - name : ' V8 on macOS/x86_64'
195165 engine : ' v8'
196166 repo : ' v8'
197- os : macos-13
167+ os : macos-15
198168 arch : x86_64
199169 action : test
200- flags : --config=hermetic-llvm-macos
170+ flags : --config=hermetic-llvm
201171 cache : true
202172 - name : ' WAMR interp on Linux/x86_64'
203173 engine : ' wamr-interp'
204174 repo : ' com_github_bytecodealliance_wasm_micro_runtime'
205175 os : ubuntu-24.04-16core
206176 arch : x86_64
207177 action : test
208- flags : --config=clang
178+ flags : --config=hermetic-llvm
209179 - name : ' WAMR interp on macOS/x86_64'
210180 engine : ' wamr-interp'
211181 repo : ' com_github_bytecodealliance_wasm_micro_runtime'
212- os : macos-13
182+ os : macos-15
213183 arch : x86_64
214184 action : test
185+ flags : --config=hermetic-llvm
215186 - name : ' WAMR jit on Linux/x86_64'
216187 engine : ' wamr-jit'
217188 repo : ' com_github_bytecodealliance_wasm_micro_runtime'
218189 os : ubuntu-24.04-16core
219190 arch : x86_64
220191 action : test
221- flags : --config=clang
192+ flags : --config=hermetic-llvm
222193 deps : lld-18
223194 cache : true
224195 - name : ' WAMR jit on macOS/x86_64'
225196 engine : ' wamr-jit'
226197 repo : ' com_github_bytecodealliance_wasm_micro_runtime'
227- os : macos-13
198+ os : macos-15
228199 arch : x86_64
229200 action : test
230201 cache : true
202+ flags : --config=hermetic-llvm
231203 - name : ' WasmEdge on Linux/x86_64'
232204 engine : ' wasmedge'
233205 repo : ' com_github_wasmedge_wasmedge'
234206 os : ubuntu-24.04-16core
235207 arch : x86_64
236208 action : test
237- flags : --config=clang
209+ flags : --config=hermetic-llvm
238210 - name : ' WasmEdge on macOS/x86_64'
239211 engine : ' wasmedge'
240212 repo : ' com_github_wasmedge_wasmedge'
241- os : macos-13
213+ os : macos-15
242214 arch : x86_64
243215 action : test
216+ flags : --config=hermetic-llvm
244217 - name : ' Wasmtime on Linux/x86_64'
245218 engine : ' wasmtime'
246219 repo : ' com_github_bytecodealliance_wasmtime'
247220 os : ubuntu-24.04-16core
248221 arch : x86_64
249222 action : test
250- flags : --config=clang -c opt
223+ flags : --config=hermetic-llvm -c opt
251224 - name : ' Wasmtime on Linux/x86_64 with ASan'
252225 engine : ' wasmtime'
253226 repo : ' com_github_bytecodealliance_wasmtime'
254227 os : ubuntu-24.04-16core
255228 arch : x86_64
256229 action : test
257- flags : --config=clang-asan --define=crypto=system
230+ flags : --config=hermetic-llvm --config= clang-asan --define=crypto=system
258231 - name : ' Wasmtime on Linux/aarch64'
259232 engine : ' wasmtime'
260233 repo : ' com_github_bytecodealliance_wasmtime'
@@ -267,21 +240,28 @@ jobs:
267240 repo : ' com_github_bytecodealliance_wasmtime'
268241 os : ubuntu-24.04-16core
269242 arch : s390x
243+ platform : linux/s390x
270244 action : test
271245 flags : --config=clang --test_timeout=1800
272246 # s390x build-tools image built from bazel/external/Dockerfile.bazel
273- run_under : docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x ghcr.io/ proxy-wasm/build-tools:ubuntu-22.04-bazel-6.5.0
247+ run_under : docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x proxy-wasm/build-tools:local-ci
274248 cache : true
275249 - name : ' Wasmtime on macOS/x86_64'
276250 engine : ' wasmtime'
277251 repo : ' com_github_bytecodealliance_wasmtime'
278- os : macos-13
252+ os : macos-15
279253 arch : x86_64
280254 action : test
255+ flags : --config=hermetic-llvm
281256
282257 steps :
283258 - uses : actions/checkout@v2
284259
260+ - name : Compute job hash
261+ id : job-hash
262+ run : echo "hash=$(echo -n '${{ matrix.engine }}-${{ matrix.flags }}-${{ matrix.os }}-${{ matrix.arch }}' | sha1sum | cut -c1-10)" >> $GITHUB_OUTPUT
263+ shell : bash
264+
285265 - name : Install dependencies (Linux)
286266 if : ${{ matrix.deps != '' && startsWith(matrix.os, 'ubuntu') }}
287267 run : sudo apt update -y && sudo apt install -y ${{ matrix.deps }}
@@ -299,27 +279,16 @@ jobs:
299279 if : startsWith(matrix.run_under, 'docker')
300280 run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
301281
302- - name : set cache name
303- id : vars
304- # The cache tag consists of the following parts:
305- # * bazel-cache- prefix
306- # * matrix.name, which separates the cache for each build type.
307- # * hash of WORKSPACE, .bazelrc, and .bazelversion, which is
308- # purely to differentiate caches for substantial changes in bazel.
309- # * github.sha, which is the commit hash of the commit used to generate
310- # the cache entry.
311- run : echo "CACHE_TAG=bazel-cache-${{ matrix.name }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion') }}" >> "$GITHUB_OUTPUT"
312-
313- - name : bazel cache
314- uses : actions/cache/restore@v3
282+ - name : Set up Docker Buildx
283+ if : startsWith(matrix.run_under, 'docker')
284+ uses : docker/setup-buildx-action@v3
285+
286+ - uses : bazel-contrib/setup-bazel@0.16.0
315287 with :
316- path : /tmp/bazel/cache
317- key : ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
318- restore-keys : |
319- ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
320- ${{ steps.vars.outputs.CACHE_TAG }}-
321- bazel-cache-${{ matrix.name }}-
322- bazel-cache-
288+ bazelisk-cache : true
289+ disk-cache : ${{ github.job }}-${{ steps.job-hash.outputs.hash }}
290+ external-cache : true
291+ repository-cache : true
323292
324293 - name : Download test data
325294 uses : actions/download-artifact@v4
@@ -336,6 +305,18 @@ jobs:
336305 echo "filegroup(name = \"$i\", srcs = [\"$i.wasm\"])" >> test/test_data/BUILD; \
337306 done
338307
308+ - name : Build local Docker image
309+ if : ${{ startsWith(matrix.run_under, 'docker') }}
310+ uses : docker/build-push-action@v6
311+ with :
312+ context : .
313+ file : bazel/external/Dockerfile.bazel
314+ platforms : ${{ matrix.platform }}
315+ tags : proxy-wasm/build-tools:local-ci
316+ load : true
317+ cache-from : type=gha,scope=build-tools-${{ matrix.platform }}
318+ cache-to : type=gha,mode=max,scope=build-tools-${{ matrix.platform }}
319+
339320 - name : Bazel build/test
340321 shell : bash
341322 run : >
@@ -344,7 +325,6 @@ jobs:
344325 --verbose_failures
345326 --test_output=errors
346327 --define engine=${{ matrix.engine }}
347- --disk_cache /tmp/bazel/cache
348328 ${{ matrix.flags }}
349329 -- //test/... ${{ matrix.targets }}
350330
@@ -356,24 +336,7 @@ jobs:
356336 --verbose_failures
357337 --test_output=errors
358338 --define engine=${{ matrix.engine }}
359- --disk_cache /tmp/bazel/cache
360339 ${{ matrix.flags }}
361- --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- )\"
340+ --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' )\"
362341 //test:signature_util_test
363342
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-
373- - name : save bazel cache
374- uses : actions/cache/save@v3
375- if : always()
376- with :
377- path : /tmp/bazel/cache
378- key : ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
379-
0 commit comments