Skip to content

Commit 427b98e

Browse files
authored
Merge pull request #8197 from onflow/bastian/extend-cadence-vm-testing
[Cadence VM] Run certain integration tests with Cadence VM
2 parents 6c89f62 + 884f0fe commit 427b98e

File tree

3 files changed

+167
-54
lines changed

3 files changed

+167
-54
lines changed

.github/workflows/ci.yml

Lines changed: 106 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126
uses: actions/checkout@v4
127127

128128
- name: Setup private build environment
129-
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
129+
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
130130
uses: ./actions/private-setup
131131
with:
132132
cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }}
@@ -210,7 +210,7 @@ jobs:
210210
uses: actions/checkout@v4
211211

212212
- name: Setup private build environment
213-
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
213+
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
214214
uses: ./actions/private-setup
215215
with:
216216
cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }}
@@ -256,7 +256,7 @@ jobs:
256256
uses: actions/checkout@v4
257257

258258
- name: Setup private build environment
259-
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
259+
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
260260
uses: ./actions/private-setup
261261
with:
262262
cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }}
@@ -301,7 +301,7 @@ jobs:
301301
fetch-depth: 0
302302

303303
- name: Setup private build environment
304-
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
304+
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
305305
uses: ./actions/private-setup
306306
with:
307307
cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }}
@@ -322,11 +322,11 @@ jobs:
322322
# this docker auth is exclusively for higher rate limits. continue unauthenticated if it fails
323323
continue-on-error: true
324324

325-
326325
- name: Docker build
327326
env:
328327
CADENCE_DEPLOY_KEY: ${{ secrets.CADENCE_DEPLOY_KEY }}
329328
run: make docker-native-build-flow docker-native-build-flow-corrupt
329+
330330
- name: Save Docker images
331331
run: |
332332
docker save \
@@ -340,13 +340,74 @@ jobs:
340340
gcr.io/flow-container-registry/access-corrupted:latest \
341341
gcr.io/flow-container-registry/execution-corrupted:latest \
342342
gcr.io/flow-container-registry/verification-corrupted:latest > flow-docker-images.tar
343+
343344
- name: Cache Docker images
344345
uses: actions/cache@v4
345346
with:
346347
path: flow-docker-images.tar
347348
# use the workflow run id as part of the cache key to ensure these docker images will only be used for a single workflow run
348349
key: flow-docker-images-${{ hashFiles('**/Dockerfile') }}-${{ github.run_id }}
349350

351+
docker-build-cadence-vm:
352+
name: Docker Build (with Cadence VM)
353+
runs-on: buildjet-16vcpu-ubuntu-2204
354+
env:
355+
CADENCE_DEPLOY_KEY: ${{ secrets.CADENCE_DEPLOY_KEY }}
356+
steps:
357+
- name: Checkout repo
358+
uses: actions/checkout@v4
359+
with:
360+
# all tags are needed for integration tests
361+
fetch-depth: 0
362+
363+
- name: Setup private build environment
364+
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
365+
uses: ./actions/private-setup
366+
with:
367+
cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }}
368+
369+
- name: Setup Go
370+
uses: actions/setup-go@v5
371+
timeout-minutes: 10 # fail fast. sometimes this step takes an extremely long time
372+
with:
373+
go-version: ${{ env.GO_VERSION }}
374+
cache: true
375+
376+
- name: Login to Docker Hub
377+
uses: docker/login-action@v3
378+
with:
379+
username: ${{ vars.DOCKERHUB_USERNAME }}
380+
password: ${{ secrets.DOCKERHUB_TOKEN }}
381+
if: ${{ (github.event_name == 'merge_group' || (github.event.pull_request && (github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR'))) }}
382+
# this docker auth is exclusively for higher rate limits. continue unauthenticated if it fails
383+
continue-on-error: true
384+
385+
- name: Docker build
386+
env:
387+
CADENCE_DEPLOY_KEY: ${{ secrets.CADENCE_DEPLOY_KEY }}
388+
run: make docker-native-build-flow docker-native-build-flow-corrupt CADENCE_VM=true
389+
390+
- name: Save Docker images
391+
run: |
392+
docker save \
393+
gcr.io/flow-container-registry/access:latest \
394+
gcr.io/flow-container-registry/collection:latest \
395+
gcr.io/flow-container-registry/consensus:latest \
396+
gcr.io/flow-container-registry/execution:latest \
397+
gcr.io/flow-container-registry/ghost:latest \
398+
gcr.io/flow-container-registry/observer:latest \
399+
gcr.io/flow-container-registry/verification:latest \
400+
gcr.io/flow-container-registry/access-corrupted:latest \
401+
gcr.io/flow-container-registry/execution-corrupted:latest \
402+
gcr.io/flow-container-registry/verification-corrupted:latest > flow-docker-images.tar
403+
404+
- name: Cache Docker images
405+
uses: actions/cache@v4
406+
with:
407+
path: flow-docker-images.tar
408+
# use the workflow run id as part of the cache key to ensure these docker images will only be used for a single workflow run
409+
key: flow-docker-images-${{ hashFiles('**/Dockerfile') }}-${{ github.run_id }}-cadence-vm
410+
350411
integration-test-others:
351412
name: Integration Tests Others (${{ matrix.targets.name }})
352413
needs: create-integration-dynamic-test-matrix
@@ -360,9 +421,9 @@ jobs:
360421
steps:
361422
- name: Checkout repo
362423
uses: actions/checkout@v4
363-
424+
364425
- name: Setup private build environment
365-
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
426+
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
366427
uses: ./actions/private-setup
367428
with:
368429
cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }}
@@ -396,14 +457,20 @@ jobs:
396457

397458
integration-test:
398459
name: Integration Tests
399-
needs: docker-build
460+
needs:
461+
- docker-build
462+
- docker-build-cadence-vm
400463
strategy:
401464
fail-fast: false
402465
matrix:
403466
include:
404467
- name: Access Cohort1 Integration Tests
405468
make: make -C integration access-cohort1-tests
406469
runner: buildjet-4vcpu-ubuntu-2204
470+
- name: Access Cohort1 Integration Tests (Cadence VM)
471+
make: make -C integration access-cohort1-tests
472+
runner: buildjet-4vcpu-ubuntu-2204
473+
cadence_vm: true
407474
- name: Access Cohort2 Integration Tests
408475
make: make -C integration access-cohort2-tests
409476
runner: ubuntu-latest
@@ -432,27 +499,55 @@ jobs:
432499
- name: Epoch Cohort1 Integration Tests
433500
make: make -C integration epochs-cohort1-tests
434501
runner: buildjet-8vcpu-ubuntu-2204
502+
- name: Epoch Cohort1 Integration Tests (Cadence VM)
503+
make: make -C integration epochs-cohort1-tests
504+
runner: buildjet-8vcpu-ubuntu-2204
505+
cadence_vm: true
435506
- name: Epoch Cohort2 Integration Tests
436507
make: make -C integration epochs-cohort2-tests
437508
runner: buildjet-4vcpu-ubuntu-2204
509+
- name: Epoch Cohort2 Integration Tests (Cadence VM)
510+
make: make -C integration epochs-cohort2-tests
511+
runner: buildjet-4vcpu-ubuntu-2204
512+
cadence_vm: true
438513
- name: Execution Integration Tests
439514
make: make -C integration execution-tests
440515
runner: ubuntu-latest
516+
- name: Execution Integration Tests (Cadence VM)
517+
make: make -C integration execution-tests
518+
runner: ubuntu-latest
519+
cadence_vm: true
441520
- name: Ghost Integration Tests
442521
make: make -C integration ghost-tests
443522
runner: ubuntu-latest
523+
- name: Ghost Integration Tests (Cadence VM)
524+
make: make -C integration ghost-tests
525+
runner: ubuntu-latest
526+
cadence_vm: true
444527
- name: MVP Integration Tests
445528
make: make -C integration mvp-tests
446529
runner: ubuntu-latest
530+
- name: MVP Integration Tests (Cadence VM)
531+
make: make -C integration mvp-tests
532+
runner: ubuntu-latest
533+
cadence_vm: true
447534
- name: Network Integration Tests
448535
make: make -C integration network-tests
449536
runner: ubuntu-latest
450537
- name: Verification Integration Tests
451538
make: make -C integration verification-tests
452539
runner: ubuntu-latest
540+
- name: Verification Integration Tests (Cadence VM)
541+
make: make -C integration verification-tests
542+
runner: ubuntu-latest
543+
cadence_vm: true
453544
- name: Upgrade Integration Tests
454545
make: make -C integration upgrades-tests
455546
runner: ubuntu-latest
547+
- name: Upgrade Integration Tests (Cadence VM)
548+
make: make -C integration upgrades-tests
549+
runner: ubuntu-latest
550+
cadence_vm: true
456551
runs-on: ${{ matrix.runner }}
457552
steps:
458553
- name: Checkout repo
@@ -462,7 +557,7 @@ jobs:
462557
fetch-depth: 0
463558

464559
- name: Setup private build environment
465-
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
560+
if: ${{ vars.PRIVATE_BUILDS_SUPPORTED == 'true' }}
466561
uses: ./actions/private-setup
467562
with:
468563
cadence_deploy_key: ${{ secrets.CADENCE_DEPLOY_KEY }}
@@ -477,8 +572,8 @@ jobs:
477572
uses: actions/cache@v4
478573
with:
479574
path: flow-docker-images.tar
480-
# use the same cache key as the docker-build job
481-
key: flow-docker-images-${{ hashFiles('**/Dockerfile') }}-${{ github.run_id }}
575+
# use the same cache key as the docker-build / docker-build-cadence-vm job
576+
key: flow-docker-images-${{ hashFiles('**/Dockerfile') }}-${{ github.run_id }}${{ matrix.cadence_vm && '-cadence-vm' || '' }}
482577
- name: Load Docker images
483578
run: docker load -i flow-docker-images.tar
484579
- name: Run tests (${{ matrix.name }})

0 commit comments

Comments
 (0)