-
Notifications
You must be signed in to change notification settings - Fork 266
717 lines (688 loc) · 27.8 KB
/
ci.yml
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
name: CI
on:
push:
branches:
- master
- provernet ./bootstrap.sh
- "*/ci-push*"
merge_group:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- labeled
branches-ignore: [devnet]
workflow_dispatch:
inputs: {}
concurrency:
# allow parallelism in master and merge queue
group: ci-${{ (contains(github.ref_name, 'gh-readonly-queue') || github.ref_name == 'master') && github.run_id || github.ref_name }}
cancel-in-progress: true
env:
CI: 1
DOCKERHUB_PASSWORD: "${{ secrets.DOCKERHUB_PASSWORD }}"
RUN_ID: ${{ github.run_id }}
RUN_ATTEMPT: ${{ github.run_attempt }}
GITHUB_TOKEN: ${{ github.token }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
GITHUB_RUN_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}"
GIT_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
RUNNER_CONCURRENCY: 0
jobs:
configure:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
# Required permissions.
permissions:
pull-requests: read
# Set job outputs to values from filter step.
# Set username to a value derived from our github username.
outputs:
username: ${{ steps.compute_username.outputs.username }}
base-images: ${{ steps.filter.outputs.base-images }}
noir: ${{ steps.filter.outputs.noir }}
noir-projects: ${{ steps.filter.outputs.noir-projects }}
bb: ${{ steps.filter.outputs.bb }}
yarn-project: ${{ steps.filter.outputs.yarn-project }}
non-docs: ${{ steps.filter.outputs.non-docs }}
non-bb: ${{ steps.filter.outputs.non-bb }}
# Test flags:
e2e-all: ${{ github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'e2e-all') || github.event_name == 'merge_group' }}
network-all: ${{ github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all') }}
e2e-list: ${{ steps.e2e_list.outputs.e2e-list }}
bench-list: ${{ steps.e2e_list.outputs.bench-list }}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: Compute Username
id: compute_username
shell: bash
env:
REPO: "${{ github.repository }}"
BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
instance_name="${BRANCH//\//_}"
echo "username=$instance_name"
echo "username=$instance_name" >> $GITHUB_OUTPUT
else
echo "username=${{ github.sha }}""
echo "username=${{ github.sha }}"" >> $GITHUB_OUTPUT
fi
- name: Create Job Lists
id: e2e_list
run: |
set -eu
LABELS=""
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
LABELS=$(jq -r '.pull_request.labels | map(.name) | join(",")' "${{ github.event_path }}")
fi
echo Labels: $LABELS
set -x
echo "e2e-list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT
echo "bench-list=$(./scripts/ci/get_bench_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: filter
with:
filters: |
noir:
- 'noir/noir-repo/**'
bb:
- 'barretenberg/cpp/**'
noir-projects:
- 'noir-projects/**'
yarn-project:
- 'yarn-project/**'
non-bb:
- '!(barretenberg/cpp/**)'
# don't consider AVM stuff 'core bb'
- barretenberg/cpp/pil/**
- barretenberg/cpp/src/barretenberg/vm/**
- barretenberg/cpp/src/barretenberg/**/generated/*
- barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.{hpp,cpp}
- barretenberg/cpp/src/barretenberg/bb/main.cpp
non-docs:
- '!(docs/**)'
# Used by CI build as a base image.
base-images:
needs: [configure]
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: "Build Images"
if: needs.configure.outputs.base-images == 'true'
uses: ./.github/ensure-builder
timeout-minutes: 120
with:
runner_type: builder-x86
username: ${{ needs.configure.outputs.username }}
run: |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
./build-images/bootstrap.sh ci
# CI for noir and bb.
ci-noir-bb:
needs: [base-images, configure]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: "CI (noir and bb)"
uses: ./.github/ensure-builder
# we place this here as ci-noir-bb is a dependency for rest of chain
if: needs.configure.outputs.noir == 'true' || needs.configure.outputs.bb == 'true'
timeout-minutes: 40
with:
runner_type: builder-x86
username: ${{ needs.configure.outputs.username }}
run: scripts/earthly-ci +ci-noir-bb
bootstrap:
needs: [ci-noir-bb, configure]
runs-on: ubuntu-latest
if: needs.configure.outputs.e2e-all == 'true' || needs.configure.outputs.non-bb == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: "CI (l1-contracts, avm-transpiler, noir-projects, yarn-project)"
uses: ./.github/ensure-builder
timeout-minutes: 40
with:
runner_type: builder-x86
username: ${{ needs.configure.outputs.username }}
run: scripts/earthly-ci +bootstrap
ci-rest:
needs: [bootstrap, configure]
runs-on: ubuntu-latest
if: needs.configure.outputs.e2e-all == 'true' || (needs.configure.outputs.non-bb == 'true' && needs.configure.outputs.non-docs == 'true')
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: "CI (l1-contracts, avm-transpiler, noir-projects, yarn-project)"
uses: ./.github/ensure-builder
timeout-minutes: 80
with:
runner_type: builder-x86
username: ${{ needs.configure.outputs.username }}
run: scripts/earthly-ci +ci-rest
images-e2e:
needs: [bootstrap, configure]
if: needs.configure.outputs.e2e-all == 'true' || (needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-bb == 'true')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: "E2E Images"
uses: ./.github/ensure-builder
timeout-minutes: 40
with:
runner_type: builder-x86
username: ${{ needs.configure.outputs.username }}
run: ./bootstrap.sh image-e2e
docs:
needs: [bootstrap, configure]
runs-on: ubuntu-latest
if: needs.configure.outputs.e2e-all == 'true' || needs.configure.outputs.non-bb == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: "Docs"
uses: ./.github/ensure-builder
timeout-minutes: 40
with:
runner_type: builder-x86
username: ${{ needs.configure.outputs.username }}
run: scripts/earthly-ci +docs-with-cache --ENV=staging --PR=${{ github.event.number }} \
--AZTEC_BOT_COMMENTER_GITHUB_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} \
--NETLIFY_AUTH_TOKEN=${{ secrets.NETLIFY_AUTH_TOKEN }} \
--NETLIFY_SITE_ID=${{ secrets.NETLIFY_SITE_ID }}
e2e:
needs: [images-e2e, configure]
if: needs.configure.outputs.e2e-all == 'true' || (needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-bb == 'true')
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test: ${{ fromJson( needs.configure.outputs.e2e-list )}}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: Test
timeout-minutes: 40
run: |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
export CI=1 USE_CACHE=1
artifact="e2e-${{matrix.test}}-$(./yarn-project/bootstrap.sh hash)"
if ci3/test_should_run "$artifact"; then
docker pull aztecprotocol/aztec:${{ env.GIT_COMMIT }}
docker pull aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
FORCE_COLOR=1 ./yarn-project/end-to-end/scripts/e2e_test.sh ${{ matrix.test }}
ci3/cache_upload_flag "$artifact"
fi
# all the benchmarking end-to-end integration tests for aztec (not required to merge)
bench-e2e:
needs: [images-e2e, configure]
if: needs.configure.outputs.e2e-all == 'true' || needs.configure.outputs.bench-list != '[]'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test: ${{ fromJson( needs.configure.outputs.bench-list )}}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: Test
timeout-minutes: 40
run: |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
export CI=1 USE_CACHE=1
artifact="bench-${{matrix.test}}-$(./yarn-project/bootstrap.sh hash)"
if ci3/test_should_run "$artifact"; then
docker pull aztecprotocol/aztec:${{ env.GIT_COMMIT }}
docker pull aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
export FORCE_COLOR=1
export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}"
./yarn-project/end-to-end/scripts/e2e_test.sh ${{ matrix.test }}
export COMMIT_HASH=${{ env.GIT_COMMIT }}
export PULL_REQUEST=${{ github.event.pull_request.number }}
export BRANCH=${{ github.ref_name }}
scripts/logs/upload_logs_to_s3.sh /usr/var/log
ci3/cache_upload_flag "$artifact"
fi
# Only e2e test that can't run on standard github runner
e2e-prover-full:
runs-on: ubuntu-latest
needs: [images-e2e, configure]
if: needs.configure.outputs.e2e-all == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: "Setup and Test"
uses: ./.github/ensure-tester
env:
USERNAME: ${{ needs.configure.outputs.username }}
timeout-minutes: 50
with:
ttl: 50
runner_type: 32core-tester-x86
run: |
export CI=1 USE_CACHE=1
artifact="e2e-prover-full-$(./yarn-project/bootstrap.sh hash)"
if ci3/test_should_run "$artifact"; then
docker pull aztecprotocol/aztec:${{ env.GIT_COMMIT }}
docker pull aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
FORCE_COLOR=1 ./yarn-project/end-to-end/scripts/e2e_test.sh e2e_prover_full
ci3/cache_upload_flag "$artifact"
fi
acir-bench:
runs-on: ubuntu-latest
needs: [ci-noir-bb, configure]
if: needs.configure.outputs.e2e-all == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: "Setup and Test"
uses: ./.github/ensure-tester
env:
USERNAME: ${{ needs.configure.outputs.username }}
timeout-minutes: 30
with:
runner_type: 16core-tester-x86
run: |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
export CI=1 USE_CACHE=1
if ci3/test_should_run acir-bench-$(./barretenberg/acir_tests/bootstrap.sh hash); then
scripts/earthly-ci ./barretenberg/acir_tests+bench-publish
ci3/cache_upload_flag acir-bench-$(./barretenberg/acir_tests/bootstrap.sh hash)
fi
# TODO(ci3) fix and reinstate
# bench-summary:
# if: needs.configure.outputs.e2e-all == 'true'
# needs:
# - acir-bench
# - bench-e2e
# - configure
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 100 # Downloading base benchmark from master requires access to history
# ref: "${{ github.event.pull_request.head.sha }}"
# - uses: ./.github/ci-setup-action
# - name: "Build and upload bench aggregate file"
# uses: ./.github/ensure-builder
# with:
# runner_type: builder-x86
# username: ${{ needs.configure.outputs.username }}
# run: scripts/earthly-ci ./yarn-project/scripts/+bench-aggregate
# - name: "Download base benchmark and package into earthly"
# if: github.event_name == 'pull_request'
# uses: ./.github/run-on-builder
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# BENCH_FOLDER: "./scripts/logs/tmp/bench"
# PULL_REQUEST: "${{ github.event.pull_request.number }}"
# with:
# run: |
# # Download the base benchmark locally (requires AWS creds and .git history)
# mkdir -p $BENCH_FOLDER
# ./scripts/logs/download_base_benchmark_from_s3.sh
# # Package it into an earthly artifact to read from bench-comment
# scripts/earthly-ci ./scripts/logs+pack-base-benchmark
# - name: "Generate summary comment if pull request"
# if: github.event_name == 'pull_request'
# uses: ./.github/run-on-builder
# env:
# AZTEC_BOT_GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
# with:
# run: scripts/earthly-ci ./yarn-project/scripts/+bench-comment
# barretenberg (prover) native, AVM (public VM) and Merkle tree (world state) tests
# ran on own runner for resource reasons (memory x cpu intensive)
bb-native-tests:
runs-on: ubuntu-latest
needs: [base-images, configure]
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: "Setup"
run: |
# Ensure we can SSH into the spot instances we request
mkdir -p ~/.ssh
echo ${{ secrets.BUILD_INSTANCE_SSH_KEY }} | base64 --decode > ~/.ssh/build_instance_key
chmod 600 ~/.ssh/build_instance_key
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
- name: "Native Prover Tests"
env:
GITHUB_LOG: 1
CI: 1
USE_CACHE: 1
run: |
export BRANCH=${{ needs.configure.outputs.username }}-bb-native-tests
if ci3/test_should_run barretenberg-test-$(./barretenberg/cpp/bootstrap.sh hash); then
ci3/bootstrap_ec2 "GITHUB_RUN_URL=$GITHUB_RUN_URL ./barretenberg/cpp/bootstrap.sh ci"
fi
kind-network-smoke:
needs: [images-e2e, configure]
if: needs.configure.outputs.e2e-all == 'true' || needs.configure.outputs.yarn-project == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: Setup and KIND Network Test
timeout-minutes: 60
uses: ./.github/ensure-tester
with:
username: ${{ needs.configure.outputs.username }}
runner_type: 8core-tester-x86
ttl: 60
run: |
docker pull aztecprotocol/aztec:${{ env.GIT_COMMIT }}
docker pull aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
cd yarn-project/end-to-end
NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=default.yaml ./scripts/network_test.sh ./src/spartan/smoke.test.ts
kind-network-test:
needs: [images-e2e, configure]
if: needs.configure.outputs.network-all == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- test: reorg.test.ts
values: 16-validators
runner_type: 16core-tester-x86-high-memory
timeout: 90
- test: 4epochs.test.ts
values: 16-validators
runner_type: 16core-tester-x86
timeout: 60
# - test: gating-passive.test.ts
# values: 16-validators
# runner_type: 16core-tester-x86
# timeout: 60
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: Setup and KIND Network Test
timeout-minutes: ${{ matrix.config.timeout }}
uses: ./.github/ensure-tester
with:
username: ${{ needs.configure.outputs.username }}
runner_type: ${{ matrix.config.runner_type }}
spot_strategy: None # use on-demand machines
ttl: ${{ matrix.config.timeout }}
run: |
export CI=1 USE_CACHE=1
artifact="kind-network-${{matrix.config.test}}-$(./yarn-project/bootstrap.sh hash)"
if ci3/test_should_run "$artifact"; then
docker pull aztecprotocol/aztec:${{ env.GIT_COMMIT }}
docker pull aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
./ci.sh test-kind-network ${{ matrix.config.test }} ${{ matrix.config.values }}
ci3/cache_upload_flag "$artifact"
fi
- name: Copy Network Logs
if: always()
run: scripts/copy_from_tester yarn-project/end-to-end/scripts/network-test.log network-test.log || true
- name: Upload Network Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: kind-network-test-${{ matrix.config.values }}-${{ matrix.config.test }}.log
path: network-test.log
bb-bench:
runs-on: ubuntu-latest
needs: [ci-noir-bb, configure]
if: needs.configure.outputs.bb == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: Build Bench Binaries
uses: ./.github/ensure-builder
with:
username: ${{ needs.configure.outputs.username }}
runner_type: builder-x86
run: |
export CI=1
export USE_CACHE=1
# We gate the build with this
if ci3/test_should_run bb-bench-$(./barretenberg/cpp/bootstrap.sh hash); then
scripts/earthly-ci --push ./barretenberg/cpp/+bench-binaries
fi
- name: Run Bench
uses: ./.github/ensure-tester
timeout-minutes: 40
with:
username: ${{ needs.configure.outputs.username }}
runner_type: 16core-tester-x86
run: |
HASH=$(ci3/cache_content_hash ./barretenberg/cpp/.rebuild_patterns)-${{ github.ref }}
export CI=1 USE_CACHE=1
if ci3/test_should_run bb-bench-$HASH; then
scripts/earthly-ci --artifact ./barretenberg/cpp/+bench/bench.json --bench_mode=cache
ci3/cache_upload_flag bb-bench-$HASH
fi
- name: Copy Bench.json
run: scripts/copy_from_tester barretenberg/cpp/bench.json bench.json || true
- name: Store benchmark result
if: github.ref == 'refs/heads/master'
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: C++ Benchmark
tool: "googlecpp"
output-file-path: bench.json
github-token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
auto-push: true
alert-threshold: "105%"
comment-on-alert: true
fail-on-alert: false
alert-comment-cc-users: "@ludamad @codygunton"
max-items-in-chart: 50
boxes-test:
needs: [ci-rest, configure]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
- uses: ./.github/ci-setup-action
- name: Build Bench Binaries
uses: ./.github/ensure-builder
timeout-minutes: 40
with:
username: ${{ needs.configure.outputs.username }}
runner_type: builder-x86
run: |
export CI=1 USE_CACHE=1
if ci3/test_should_run "boxes-test-$(./boxes/bootstrap.sh hash)"; then
./bootstrap.sh test-boxes
fi
prover-client-test:
needs: [ci-rest, configure]
runs-on: ubuntu-latest
if: needs.configure.outputs.e2e-all == 'true' || needs.configure.outputs.noir == 'true' || needs.configure.outputs.bb == 'true' || needs.configure.outputs.noir-projects == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
- uses: ./.github/ci-setup-action
- name: Test
uses: ./.github/ensure-builder
timeout-minutes: 40
with:
username: ${{ needs.configure.outputs.username }}
runner_type: builder-x86
run: |
export CI=1 USE_CACHE=1
scripts/earthly-ci +prover-client-with-cache
rough-rhino-installer:
needs: [bootstrap, configure]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
- uses: ./.github/ci-setup-action
- name: Rough Rhino Installer Helper Script
uses: ./.github/ensure-builder
timeout-minutes: 40
with:
username: ${{ needs.configure.outputs.username }}
runner_type: builder-x86
run: |
scripts/earthly-ci ./spartan/releases/rough-rhino/+test-all
protocol-circuits-gates-report:
needs: [ci-rest, configure]
if: needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-bb == 'true'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: "Noir Protocol Circuits Report"
uses: ./.github/ensure-builder
timeout-minutes: 40
with:
username: ${{ needs.configure.outputs.username }}
runner_type: builder-x86
run: |
scripts/earthly-ci --artifact ./noir-projects/+gates-report/gates_report.json
- name: Copy Report
run: |
scripts/copy_from_builder ./noir-projects/gates_report.json protocol_circuits_report.json
- name: Compare gates reports
id: gates_diff
uses: vezenovm/noir-gates-diff@510d7da8a7b027510ca0734761dfa9bcf3e8309d
continue-on-error: true
timeout-minutes: 1
with:
report: protocol_circuits_report.json
summaryQuantile: 0 # Display any diff in gate count
- name: Add gates diff to sticky comment
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
continue-on-error: true
with:
# delete the comment in case changes no longer impact circuit sizes
delete: ${{ !steps.gates_diff.outputs.markdown }}
message: ${{ steps.gates_diff.outputs.markdown }}
public-functions-size-report:
needs: [ci-rest, configure]
if: needs.configure.outputs.non-docs == 'true'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: "Aztec Public Functions Bytecode Size Report"
timeout-minutes: 40
uses: ./.github/ensure-builder
with:
username: ${{ needs.configure.outputs.username }}
runner_type: builder-x86
run: |
scripts/earthly-ci --artifact ./noir-projects/+public-functions-report/public_functions_report.json
- name: Copy Report
run: |
scripts/copy_from_builder noir-projects/public_functions_report.json public_functions_report.json
- name: Compare public functions bytecode size reports
id: public_functions_sizes_diff
uses: noir-lang/noir-gates-diff@d88f7523b013b9edd3f31c5cfddaef87a3fe1b48
continue-on-error: true
timeout-minutes: 1
with:
report: public_functions_report.json
header: |
# Changes to public function bytecode sizes
brillig_report: true
brillig_report_bytes: true
summaryQuantile: 0 # Display any diff in bytecode size count
- name: Add bytecode size diff to sticky comment
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
continue-on-error: true
timeout-minutes: 1
with:
header: public_functions_size
delete: ${{ !steps.public_functions_sizes_diff.outputs.markdown }}
message: ${{ steps.public_functions_sizes_diff.outputs.markdown }}
merge-check:
runs-on: ubuntu-latest
needs:
- configure
- base-images
- bootstrap
- ci-noir-bb
- ci-rest
- images-e2e
- docs
- e2e
- e2e-prover-full
- bb-native-tests
- kind-network-smoke
- kind-network-test
- boxes-test
- rough-rhino-installer
if: always()
outputs:
failure: ${{ steps.set_failed_jobs.outputs.failure }}
failed_jobs: ${{ steps.set_failed_jobs.outputs.failed_jobs }}
steps:
- name: Check for Failures and Set Output
id: set_failed_jobs
env:
NEEDS_JOBS_JSON: ${{ toJson(needs) }}
run: |
echo "Processing failed jobs..."
failed_jobs=$(echo "$NEEDS_JOBS_JSON" | jq -r 'to_entries[] | select(.value.result == "failure") | .key' | paste -sd "," -)
echo "$failed_jobs" > .failed
echo "failure=${{contains(needs.*.result, 'failure')}}" >> $GITHUB_OUTPUT
echo "failed_jobs=$failed_jobs" >> $GITHUB_OUTPUT
- name: Report overall success (non-draft)
if: github.event.pull_request.draft == false
env:
# We treat any skipped or failing jobs as a failure for the workflow as a whole.
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: |
if [[ $FAIL == true ]]; then
echo "Jobs failed: $(cat .failed), merging not allowed."
exit 1
else
echo "All jobs succeeded, merge allowed."
exit 0
fi
- name: Block merge (draft)
if: github.event.pull_request.draft
run: echo "Can't merge drafts." && exit 1
notify:
runs-on: ubuntu-latest
needs:
- merge-check
if: github.event.pull_request.draft == false && github.ref == 'refs/heads/master' && failure()
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get Authors of Recent Commit
id: get_authors
run: |
git fetch --depth=1 origin ${{ github.sha }}
authors=$(git log -1 --pretty=format:'%an <%ae>' ${{ github.sha }})
echo "authors=${authors}" >> $GITHUB_OUTPUT
- name: Send notification to aztec3-ci channel if workflow failed on master
uses: slackapi/[email protected]
with:
payload: |
{
"text": "Master Github Actions failure",
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"authors": "${{ steps.get_authors.outputs.authors }}",
"failed_jobs": "${{ needs.merge-check.outputs.failed_jobs }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WORKFLOW_TRIGGER_URL2 }}