1
1
name : CI
2
+ concurrency :
3
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
4
+ cancel-in-progress : true
2
5
on :
3
6
pull_request :
4
7
push :
@@ -7,9 +10,9 @@ defaults:
7
10
run :
8
11
shell : bash
9
12
env :
10
- # Note: when updated, also update version in ensure_cargo_installs
13
+ # Note: when updated, also update version in ensure-cargo-installs
11
14
viceroy_version : 0.12.0
12
- # Note: when updated, also update version in ensure_cargo_installs
15
+ # Note: when updated, also update version in ensure-cargo-installs
13
16
wasm-tools_version : 1.216.0
14
17
fastly-cli_version : 10.13.3
15
18
37
40
- run : cd documentation && npm ci
38
41
- run : cd documentation && npm run build
39
42
40
- ensure_cargo_installs :
43
+ ensure-cargo-installs :
41
44
name : Ensure that all required "cargo install" commands are run, or we have a cache hit
42
45
strategy :
43
46
matrix :
@@ -153,13 +156,39 @@ jobs:
153
156
- run : npm install
154
157
- run : npm test
155
158
159
+ build-debug :
160
+ name : Debug Build
161
+ needs : [ensure-cargo-installs]
162
+ runs-on : ubuntu-latest
163
+ steps :
164
+ - uses : actions/checkout@v3
165
+ with :
166
+ submodules : true
167
+ - name : Install Rust 1.77.1
168
+ run : |
169
+ rustup toolchain install 1.77.1
170
+ rustup target add wasm32-wasi --toolchain 1.77.1
171
+ - name : Restore wasm-tools from cache
172
+ uses : actions/cache@v3
173
+ id : wasm-tools
174
+ with :
175
+ path : " /home/runner/.cargo/bin/wasm-tools"
176
+ key : crate-cache-wasm-tools-${{ env.wasm-tools_version }}
177
+ - name : Build
178
+ run : npm run build:debug
179
+ - uses : actions/upload-artifact@v3
180
+ with :
181
+ if-no-files-found : error
182
+ name : fastly-debug
183
+ path : fastly.debug.wasm
184
+
156
185
build :
157
186
name : Build
158
- needs : [ensure_cargo_installs ]
187
+ needs : [ensure-cargo-installs ]
159
188
runs-on : ubuntu-latest
160
189
strategy :
161
190
matrix :
162
- profile : [debug, release, weval]
191
+ profile : [release, weval]
163
192
steps :
164
193
- uses : actions/checkout@v3
165
194
with :
@@ -177,9 +206,6 @@ jobs:
177
206
- name : Build
178
207
if : ${{ matrix.profile == 'release' }}
179
208
run : npm run build
180
- - name : Build
181
- if : ${{ matrix.profile == 'debug' }}
182
- run : npm run build:debug
183
209
- name : Build
184
210
if : ${{ matrix.profile == 'weval' }}
185
211
run : npm run build:weval
@@ -194,13 +220,58 @@ jobs:
194
220
name : fastly-${{ matrix.profile }}-ic-cache
195
221
path : fastly-ics.wevalcache
196
222
197
- run_wpt :
223
+ run-wpt-debug :
224
+ if : github.ref != 'refs/heads/main'
225
+ name : Run Web Platform Tests Debug
226
+ needs : [build-debug, ensure-cargo-installs]
227
+ runs-on : ubuntu-latest
228
+ steps :
229
+ - uses : actions/checkout@v3
230
+ with :
231
+ submodules : true
232
+ - uses : actions/setup-node@v3
233
+ with :
234
+ node-version : ' lts/*'
235
+
236
+ - name : Download Engine
237
+ uses : actions/download-artifact@v3
238
+ with :
239
+ name : fastly-debug
240
+
241
+ - name : Restore Viceroy from cache
242
+ uses : actions/cache@v3
243
+ with :
244
+ path : " /home/runner/.cargo/bin/viceroy"
245
+ key : crate-cache-viceroy-${{ env.viceroy_version }}
246
+
247
+ - name : Restore wasm-tools from cache
248
+ uses : actions/cache@v3
249
+ id : wasm-tools
250
+ with :
251
+ path : " /home/runner/.cargo/bin/wasm-tools"
252
+ key : crate-cache-wasm-tools-${{ env.wasm-tools_version }}
253
+
254
+ - run : npm install
255
+
256
+ - name : Build WPT runtime
257
+ run : tests/wpt-harness/build-wpt-runtime.sh --debug-build
258
+
259
+ - name : Prepare WPT hosts
260
+ run : |
261
+ cd tests/wpt-harness/wpt
262
+ ./wpt make-hosts-file | sudo tee -a /etc/hosts
263
+
264
+ - name : Run tests
265
+ timeout-minutes : 20
266
+ run : node ./tests/wpt-harness/run-wpt.mjs -vv
267
+
268
+ run-wpt :
198
269
strategy :
199
270
matrix :
200
- profile : [debug, release, weval]
271
+ profile : [release, weval]
201
272
if : github.ref != 'refs/heads/main'
202
273
name : Run Web Platform Tests
203
- needs : [build, ensure_cargo_installs ]
274
+ needs : [build, ensure-cargo-installs ]
204
275
runs-on : ubuntu-latest
205
276
steps :
206
277
- uses : actions/checkout@v3
@@ -257,8 +328,8 @@ jobs:
257
328
fail-fast : false
258
329
matrix :
259
330
platform : [viceroy, compute]
260
- profile : [debug, release, weval]
261
- needs : [build, ensure_cargo_installs ]
331
+ profile : [release, weval]
332
+ needs : [build, ensure-cargo-installs ]
262
333
steps :
263
334
- name : Checkout fastly/js-compute-runtime
264
335
uses : actions/checkout@v3
@@ -300,17 +371,75 @@ jobs:
300
371
with :
301
372
name : fastly-${{ matrix.profile }}-ic-cache
302
373
303
- - run : npm install
374
+ - name : Npm install
375
+ run : npm install && cd ./integration-tests/js-compute && npm install
376
+
377
+ - name : Run Tests
378
+ run : SUFFIX_STRING=${{matrix.profile}} node integration-tests/js-compute/test.js ${{ matrix.platform == 'viceroy' && '--local' || '' }} ${{ matrix.profile == 'weval' && '--aot' || '' }}
379
+ env :
380
+ FASTLY_API_TOKEN : ${{ secrets.FASTLY_API_TOKEN }}
381
+
382
+ - name : Run TLA Tests
383
+ run : SUFFIX_STRING=${{matrix.profile}} node integration-tests/js-compute/test.js --tla ${{ matrix.platform == 'viceroy' && '--local' || '' }} ${{ matrix.profile == 'weval' && '--aot' || '' }}
384
+ env :
385
+ FASTLY_API_TOKEN : ${{ secrets.FASTLY_API_TOKEN }}
386
+
387
+ sdktest-debug :
388
+ concurrency :
389
+ group : ${{ github.head_ref }}--sdktest-debug-${{matrix.platform}}
390
+ if : github.ref != 'refs/heads/main'
391
+ runs-on : ubuntu-latest
392
+ strategy :
393
+ fail-fast : false
394
+ matrix :
395
+ platform : [viceroy, compute]
396
+ needs : [build-debug, ensure-cargo-installs]
397
+ steps :
398
+ - name : Checkout fastly/js-compute-runtime
399
+ uses : actions/checkout@v3
400
+ with :
401
+ submodules : false
402
+ ref : ${{ github.head_ref || github.ref_name }}
403
+ - uses : actions/setup-node@v3
404
+ with :
405
+ node-version : ' lts/*'
406
+
407
+ - name : Set up Fastly CLI
408
+ uses : fastly/compute-actions/setup@v4
409
+ with :
410
+ token : ${{ secrets.GITHUB_TOKEN }}
411
+ cli_version : ${{ env.fastly-cli_version }}
412
+
413
+ - name : Restore Viceroy from cache
414
+ if : ${{ matrix.platform == 'viceroy' }}
415
+ uses : actions/cache@v3
416
+ id : viceroy
417
+ with :
418
+ path : " /home/runner/.cargo/bin/viceroy"
419
+ key : crate-cache-viceroy-${{ env.viceroy_version }}
420
+
421
+ - name : Restore wasm-tools from cache
422
+ uses : actions/cache@v3
423
+ id : wasm-tools
424
+ with :
425
+ path : " /home/runner/.cargo/bin/wasm-tools"
426
+ key : crate-cache-wasm-tools-${{ env.wasm-tools_version }}
427
+
428
+ - name : Download Engine
429
+ uses : actions/download-artifact@v3
430
+ with :
431
+ name : fastly-debug
304
432
305
433
- name : Npm install
306
434
run : npm install && cd ./integration-tests/js-compute && npm install
307
435
308
436
- name : Run Tests
309
- run : SUFFIX_STRING=${{matrix.profile}} node integration-tests/js-compute/test.js ${{ matrix.platform == 'viceroy' && '--local' || '' }} ${{ matrix.profile == 'weval' && '--aot' || '' }} ${{ matrix.profile == 'debug ' && '--debug-build ' || '' }}
437
+ run : SUFFIX_STRING=debug node integration-tests/js-compute/test.js --debug-build ${{ matrix.platform == 'viceroy ' && '--local ' || '' }}
310
438
env :
311
439
FASTLY_API_TOKEN : ${{ secrets.FASTLY_API_TOKEN }}
312
440
313
441
- name : Run TLA Tests
314
- run : SUFFIX_STRING=${{matrix.profile}} node integration-tests/js-compute/test.js --tla ${{ matrix.platform == 'viceroy' && '--local' || '' }} ${{ matrix.profile == 'weval' && '--aot' || '' }} ${{ matrix.profile == 'debug ' && '--debug-build ' || '' }}
442
+ run : SUFFIX_STRING=debug node integration-tests/js-compute/test.js --tla --debug-build ${{ matrix.platform == 'viceroy ' && '--local ' || '' }}
315
443
env :
316
444
FASTLY_API_TOKEN : ${{ secrets.FASTLY_API_TOKEN }}
445
+
0 commit comments