-
Notifications
You must be signed in to change notification settings - Fork 84
324 lines (292 loc) · 10.8 KB
/
test.yml
File metadata and controls
324 lines (292 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Test
on:
pull_request:
branches:
- main
- 'envoy-release/**'
- 'istio-release/**'
push:
branches:
- main
- 'envoy-release/**'
- 'istio-release/**'
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.run_id }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
test_data:
name: build test data
runs-on: ubuntu-24.04
steps:
- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/share/swift /usr/local/.ghcup /usr/local/julia* /usr/local/lib/android /usr/local/share/chromium /opt/microsoft /opt/google /usr/lib/firefox /opt/hostedtoolcache
echo "Free disk space: " $(df -h /)
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
with:
disk-cache: ${{ github.job }}
cache-save: ${{ github.event_name != 'pull_request' }}
- name: Bazel build
run: >
bazel build
--verbose_failures
--test_output=errors
--config=clang
--config=hermetic-llvm
-c opt
$(bazel query 'kind(was.*_rust_binary, //test/test_data/...)')
$(bazel query 'kind(_optimized_wasm_cc_binary, //test/test_data/...)')
# Currently, in Github Action, "Bazel build step" creates `wasm_canary_check.wasm` directory as a temporal directory.
# Since the name of this directory has "*.wasm" pattern, the step "Mangle build rules to use existing test data" fails.
# So, here, we clear out the directories in test_data.
- name: Clean up test data
shell: bash
run: |
# Remove temporal directories
for i in $(find bazel-bin/test/test_data/ -mindepth 1 -maxdepth 1 -type d); do \
rm -rf $i; \
done
- name: Upload test data
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test_data
path: bazel-bin/test/test_data/*.wasm
if-no-files-found: error
retention-days: 3
build:
name: ${{ matrix.action }} with ${{ matrix.name }}
needs: test_data
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: 'NullVM on Linux/x86_64'
engine: 'null'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=gcc
- name: 'NullVM on Linux/x86_64 with ASan'
engine: 'null'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=hermetic-llvm --config=clang-asan --define=crypto=system
- name: 'NullVM on Linux/x86_64 with TSan'
engine: 'null'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=hermetic-llvm --config=clang-tsan
- name: 'NullVM on Windows/x86_64'
engine: 'null'
os: windows-2022
arch: x86_64
action: test
targets: -//test/fuzz/...
- name: 'V8 on Linux/x86_64'
engine: 'v8'
repo: 'v8'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=hermetic-llvm --define=crypto=system
cache: true
- name: 'V8 on Linux/x86_64 with ASan'
engine: 'v8'
repo: 'v8'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=hermetic-llvm --config=clang-asan
cache: true
- name: 'V8 on Linux/x86_64 with TSan'
engine: 'v8'
repo: 'v8'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=hermetic-llvm --config=clang-tsan
cache: true
- name: 'V8 on Linux/x86_64 with GCC'
engine: 'v8'
repo: 'v8'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=gcc
cache: true
- name: 'V8 on Linux/aarch64'
engine: 'v8'
repo: 'v8'
os: ubuntu-24.04-arm
arch: aarch64
action: test
targets: -//test/fuzz/...
flags: --config=hermetic-llvm --@v8//bazel/config:v8_target_cpu=arm64
cache: true
- name: 'V8 on macOS/x86_64'
engine: 'v8'
repo: 'v8'
os: macos-15
arch: x86_64
action: test
flags: --config=hermetic-llvm
cache: true
- name: 'WAMR interp on Linux/x86_64'
engine: 'wamr-interp'
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=hermetic-llvm
- name: 'WAMR interp on macOS/x86_64'
engine: 'wamr-interp'
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
os: macos-15
arch: x86_64
action: test
flags: --config=hermetic-llvm
- name: 'WAMR jit on Linux/x86_64'
engine: 'wamr-jit'
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=hermetic-llvm
deps: lld-18
cache: true
- name: 'WAMR jit on macOS/x86_64'
engine: 'wamr-jit'
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
os: macos-15
arch: x86_64
action: test
cache: true
flags: --config=hermetic-llvm
- name: 'WasmEdge on Linux/x86_64'
engine: 'wasmedge'
repo: 'com_github_wasmedge_wasmedge'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=hermetic-llvm
- name: 'WasmEdge on macOS/x86_64'
engine: 'wasmedge'
repo: 'com_github_wasmedge_wasmedge'
os: macos-15
arch: x86_64
action: test
flags: --config=hermetic-llvm
- name: 'Wasmtime on Linux/x86_64'
engine: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=hermetic-llvm -c opt
- name: 'Wasmtime on Linux/x86_64 with ASan'
engine: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: ubuntu-24.04
arch: x86_64
action: test
flags: --config=hermetic-llvm --config=clang-asan --define=crypto=system
- name: 'Wasmtime on Linux/aarch64'
engine: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: ubuntu-24.04-arm
arch: aarch64
action: build
flags: --config=hermetic-llvm
- name: 'Wasmtime on Linux/s390x'
engine: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: ubuntu-24.04
arch: s390x
action: test
flags: --config=clang --test_timeout=1800
# s390x build-tools image built from bazel/external/Dockerfile.bazel
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-24.04-bazel-7.7.1
cache: true
- name: 'Wasmtime on macOS/x86_64'
engine: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: macos-15
arch: x86_64
action: test
flags: --config=hermetic-llvm
steps:
- name: Free up disk space
if: ${{ matrix.deps != '' && startsWith(matrix.os, 'ubuntu') }}
run: |
sudo rm -rf /usr/share/dotnet /usr/share/swift /usr/local/.ghcup /usr/local/julia* /usr/local/lib/android /usr/local/share/chromium /opt/microsoft /opt/google /usr/lib/firefox /opt/hostedtoolcache
echo "Free disk space: " $(df -h /)
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Compute job hash
id: job-hash
run: echo "hash=$(echo -n '${{ matrix.engine }}-${{ matrix.flags }}-${{ matrix.os }}-${{ matrix.arch }}' | sha1sum | cut -c1-10)" >> $GITHUB_OUTPUT
shell: bash
- name: Install dependencies (Linux)
if: ${{ matrix.deps != '' && startsWith(matrix.os, 'ubuntu') }}
run: sudo apt update -y && sudo apt install -y ${{ matrix.deps }}
- name: Activate Docker/QEMU
if: startsWith(matrix.run_under, 'docker')
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
if: ${{ matrix.cache }}
with:
disk-cache: ${{ github.job }}-${{ steps.job-hash.outputs.hash }}
cache-save: ${{ github.event_name != 'pull_request' }}
- name: Download test data
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: test_data
path: test/test_data/
- name: Mangle build rules to use existing test data
shell: bash
run: |
sed 's/\.wasm//g' test/BUILD > test/BUILD.tmp && mv test/BUILD.tmp test/BUILD
echo "package(default_visibility = [\"//visibility:public\"])" > test/test_data/BUILD
for i in $(cd test/test_data && ls -1 *.wasm | sed 's/\.wasm$//g'); do \
echo "filegroup(name = \"$i\", srcs = [\"$i.wasm\"])" >> test/test_data/BUILD; \
done
- name: Bazel build/test
shell: bash
run: >
${{ matrix.run_under }}
bazel ${{ matrix.action }}
--verbose_failures
--test_output=errors
--define engine=${{ matrix.engine }}
${{ matrix.flags }}
-- //test/... ${{ matrix.targets }}
- name: Bazel build/test (signed Wasm module)
if: ${{ matrix.engine != 'null' && !startsWith(matrix.os, 'windows') }}
run: >
${{ matrix.run_under }}
bazel ${{ matrix.action }}
--verbose_failures
--test_output=errors
--define engine=${{ matrix.engine }}
${{ matrix.flags }}
--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')\"
//test:signature_util_test