-
Notifications
You must be signed in to change notification settings - Fork 265
1073 lines (1022 loc) · 42.5 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
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: CI
on:
push:
branches:
- master
- provernet
- "*/ci-push*"
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- labeled
branches-ignore: [devnet]
workflow_dispatch:
inputs: {}
concurrency:
# force parallelism in master
group: ci-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}
cancel-in-progress: true
env:
DOCKERHUB_PASSWORD: "${{ secrets.DOCKERHUB_PASSWORD }}"
RUN_ID: ${{ github.run_id }}
RUN_ATTEMPT: ${{ github.run_attempt }}
GITHUB_TOKEN: ${{ github.token }}
GH_SELF_HOSTED_RUNNER_TOKEN: ${{ secrets.GH_SELF_HOSTED_RUNNER_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 }}
GIT_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
# kludge until we move away from runners
WAIT_FOR_RUNNERS: false
jobs:
configure:
runs-on: ubuntu-20.04
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 }}
avm-transpiler: ${{ steps.filter.outputs.avm-transpiler }}
build-images: ${{ steps.filter.outputs.build-images }}
barretenberg: ${{ steps.filter.outputs.barretenberg }}
barretenberg-cpp: ${{ steps.filter.outputs.barretenberg-cpp }}
noir: ${{ steps.filter.outputs.noir }}
noir-projects: ${{ steps.filter.outputs.noir-projects }}
yarn-project: ${{ steps.filter.outputs.yarn-project }}
txe: ${{ steps.filter.outputs.txe }}
l1-contracts: ${{ steps.filter.outputs.l1-contracts }}
non-docs: ${{ steps.filter.outputs.non-docs }}
non-misc-ci: ${{ steps.filter.outputs.non-misc-ci }}
non-barretenberg-cpp: ${{ steps.filter.outputs.non-barretenberg-cpp }}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: Compute Username
id: compute_username
shell: bash
env:
REPO: "${{ github.repository }}"
BRANCH: "${{ github.ref_name }}"
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "username=${{ github.event.pull_request.user.login }}"
echo "username=${{ github.event.pull_request.user.login }}" >> $GITHUB_OUTPUT
else
GIT_HASH="${{ github.sha }}"
GIT_HASH_LAST8=${GIT_HASH: -8}
GIT_HASH_LAST8_DEC=$(printf "%d" 0x$GIT_HASH_LAST8)
GIT_HASH_MODULO_8=$((GIT_HASH_LAST8_DEC % 8))
echo "username=master-${GIT_HASH_MODULO_8}"
echo "username=master-${GIT_HASH_MODULO_8}" >> $GITHUB_OUTPUT
fi
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: filter
with:
filters: |
barretenberg:
- 'barretenberg/**'
barretenberg-cpp:
- 'barretenberg/cpp/**'
build-images:
- 'build-images/**'
noir:
- 'noir/**'
avm-transpiler:
- 'avm-transpiler/**'
l1-contracts:
- 'l1-contracts/**'
noir-projects:
- 'noir-projects/**'
yarn-project:
- 'yarn-project/**'
txe:
- 'yarn-project/txe/**'
non-barretenberg-cpp:
- '!(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/**)'
non-misc-ci:
- '!(.github/**)'
# Always rebuild when this file changes
- .github/workflows/ci.yml
setup:
needs: [configure]
if: github.event.pull_request.draft == false
uses: ./.github/workflows/setup-runner.yml
with:
username: ${{ needs.configure.outputs.username }}
runner_type: builder-x86
secrets: inherit
build-images:
needs: [setup, configure]
# Note we don't but the 'if' here as that would also apply to dependent jobs, instead we just copy it into each step
runs-on: ${{ needs.configure.outputs.username }}-x86
steps:
- uses: actions/checkout@v4
if: needs.configure.outputs.build-images == 'true'
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
if: needs.configure.outputs.build-images == 'true'
with:
concurrency_key: build-images-x86
- name: "Push Build Images If Changed"
if: needs.configure.outputs.build-images == 'true'
timeout-minutes: 40
run: |
earthly-ci --push ./build-images/+build
build:
needs: [build-images, configure]
# NOTE: we don't skip this job here instead using if's below to avoid gotcha if dependent jobs have their own if's
runs-on: ${{ needs.configure.outputs.username }}-x86
outputs:
e2e_list: ${{ steps.e2e_list.outputs.list }}
bench_list: ${{ steps.bench_list.outputs.list }}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-x86
# prepare images locally, tagged by commit hash
- name: "Build E2E Image"
timeout-minutes: 40
if: (needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-barretenberg-cpp == 'true') || github.ref_name == 'master'
run: |
earthly-ci ./yarn-project+export-e2e-test-images
# We base our e2e list used in e2e-x86 off the targets in ./yarn-project/end-to-end
# (Note ARM uses just 2 tests as a smoketest)
- name: Create list of non-bench end-to-end jobs
id: e2e_list
run: |
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
LABELS=$(jq -r '.pull_request.labels | map(.name) | join(",")' "$GITHUB_EVENT_PATH")
else
LABELS=""
fi
echo Labels: $LABELS
echo "list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")"
echo "list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT
- name: Create list of bench end-to-end jobs
id: bench_list
run: |
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
LABELS=$(jq -r '.pull_request.labels | map(.name) | join(",")' "$GITHUB_EVENT_PATH")
else
LABELS=""
fi
echo Labels: $LABELS
echo "list=$(./scripts/ci/get_bench_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT
# all the non-bench end-to-end integration tests for aztec
e2e:
needs: [build, configure]
if: (needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-barretenberg-cpp == 'true') || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'e2e')
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
test: ${{ fromJson( needs.build.outputs.e2e_list )}}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: Determine runner type
id: runner_type
run: |
runner=$(./scripts/ci/select_runner.sh ${{ matrix.test }})
echo "type=$runner" >> $GITHUB_OUTPUT
- name: Setup and Test
timeout-minutes: 40
uses: ./.github/ensure-tester-with-images
env:
USERNAME: ${{ needs.configure.outputs.username }}
PULL_REQUEST: ${{ github.event.pull_request.number }}
with:
runner_type: ${{ steps.runner_type.outputs.type }}
builder_type: builder-x86
builder_images_to_copy: aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images
run: |
set -eux
cd ./yarn-project/end-to-end/
export FORCE_COLOR=1
./scripts/e2e_test.sh ${{ matrix.test }}
# all the benchmarking end-to-end integration tests for aztec (not required to merge)
bench-e2e:
needs: [build, configure]
if: needs.build.outputs.bench_list != '[]' && ((needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-barretenberg-cpp == 'true') || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'bench'))
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
test: ${{ fromJson( needs.build.outputs.bench_list )}}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: Determine runner type
id: runner_type
run: |
runner=$(./scripts/ci/select_runner.sh ${{ matrix.test }})
echo "type=$runner" >> $GITHUB_OUTPUT
- name: Setup and Test
uses: ./.github/ensure-tester-with-images
env:
USERNAME: ${{ needs.configure.outputs.username }}
timeout-minutes: 45
with:
runner_type: ${{ steps.runner_type.outputs.type }}
builder_type: builder-x86
# these are copied to the tester and expected by the earthly command below
# if they fail to copy, it will try to build them on the tester and fail
builder_images_to_copy: aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
# command to produce the images in case they don't exist
builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images
tester_ttl: 40
run: |
set -eux
cd ./yarn-project/end-to-end/
export FORCE_COLOR=1
export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}"
./scripts/e2e_test.sh ${{ matrix.test }}
# TODO(#9692): disabled after refactoring - trying to call function as target
# ../../scripts/earthly-ci +UPLOAD_LOGS --PULL_REQUEST=${{ github.event.pull_request.number }} --BRANCH=${{ github.ref_name }} --COMMIT_HASH=${{ env.GIT_COMMIT }}
acir-bench:
runs-on: ubuntu-20.04
needs: [build, configure]
# Note: not fully accurate, but to work with bench-summary needs to be the same as bench-e2e
if: needs.configure.outputs.non-barretenberg-cpp == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: Setup and Test
uses: ./.github/ensure-tester-with-images
env:
USERNAME: ${{ needs.configure.outputs.username }}
timeout-minutes: 40
with:
runner_type: 16core-tester-x86
builder_type: builder-x86
# these are copied to the tester and expected by the earthly command below
# if they fail to copy, it will try to build them on the tester and fail
builder_images_to_copy: aztecprotocol/barretenberg-acir-benches:${{ env.GIT_COMMIT }}
# command to produce the images in case they don't exist
builder_command: cd noir && ../scripts/earthly-ci +export-bench-acir-bb
run: |
set -eux
cd ./noir/
export FORCE_COLOR=1
export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}"
../scripts/earthly-ci -P --no-output +bench-publish-acir-bb
bench-summary:
needs:
- acir-bench
- bench-e2e
- configure
runs-on: ${{ needs.configure.outputs.username }}-x86
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
with:
concurrency_key: bench-summary-x86
- name: "Build and upload bench aggregate file"
working-directory: ./yarn-project/scripts
run: |
earthly-ci -P +bench-aggregate
- name: "Download base benchmark and package into earthly"
if: github.event_name == 'pull_request'
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
earthly-ci -P ./scripts/logs+pack-base-benchmark
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 }}"
- name: "Generate summary comment if pull request"
if: github.event_name == 'pull_request'
working-directory: ./yarn-project/scripts
run: |
earthly-ci -P +bench-comment
env:
AZTEC_BOT_GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
bb-gcc:
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.barretenberg-cpp == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
# must be globally unique for build x runner
concurrency_key: bb-gcc
- name: "Ensure GCC Builds"
working-directory: ./barretenberg/cpp/
timeout-minutes: 40
# limit our parallelism to half our cores
run: earthly-ci --no-output +preset-gcc
# 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-20.04
needs: [build-images, configure]
if: needs.configure.outputs.barretenberg-cpp == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: "Native Prover Tests"
uses: ./.github/ensure-tester
env:
USERNAME: ${{ needs.configure.outputs.username }}
# note: tester by default times out at 30, would need to delay shutdwon for more
timeout-minutes: 30
with:
runner_type: 128core-tester-x86
run: |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
scripts/earthly-ci --exec-stats --no-output --no-cache ./barretenberg/cpp+test --hardware_concurrency=32
bb-js-test:
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.barretenberg == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: bb-js-test-x86
- name: "bb.js Tests"
working-directory: ./barretenberg/ts/
timeout-minutes: 40
run: earthly-ci --no-output ./+test
noir-build-acir-tests:
needs: [build-images, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.barretenberg == 'true' || needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-acir-tests-x86
- name: "Build Acir Tests"
timeout-minutes: 40
run: earthly-ci --no-output ./noir/+build-acir-tests
bb-acir-tests-bb:
needs: [noir-build-acir-tests, build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.barretenberg == 'true' || needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: barretenberg-acir-tests-bb-x86
- name: "BB Native Acir Tests (Misc)"
working-directory: ./barretenberg/
timeout-minutes: 40
run: earthly-ci --no-output ./+barretenberg-acir-tests-bb
bb-acir-tests-bb-ultra-plonk:
needs: [noir-build-acir-tests, build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.barretenberg == 'true' || needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: barretenberg-acir-tests-bb-ultra-plonk-x86
- name: "BB Native Acir Tests (Ultraplonk)"
working-directory: ./barretenberg/
timeout-minutes: 40
run: earthly-ci --no-output ./+barretenberg-acir-tests-bb-ultra-plonk
bb-acir-tests-bb-ultra-honk:
needs: [noir-build-acir-tests, build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.barretenberg == 'true' || needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: barretenberg-acir-tests-bb-ultra-honk-x86
- name: "BB Native Acir Tests (Ultrahonk)"
working-directory: ./barretenberg/
timeout-minutes: 40
run: earthly-ci --no-output ./+barretenberg-acir-tests-bb-ultra-honk
bb-acir-tests-bb-mega-honk:
needs: [noir-build-acir-tests, build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.barretenberg == 'true' || needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: barretenberg-acir-tests-bb-mega-honk-x86
- name: "BB Native Acir Tests (Megahonk)"
working-directory: ./barretenberg/
timeout-minutes: 40
run: earthly-ci --no-output ./+barretenberg-acir-tests-bb-mega-honk
bb-acir-tests-sol:
needs: [noir-build-acir-tests, build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.barretenberg == 'true' || needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: barretenberg-acir-tests-sol-x86
- name: "BB Solidity Acir Tests"
working-directory: ./barretenberg/
timeout-minutes: 40
run: earthly-ci --no-output ./+barretenberg-acir-tests-sol
bb-acir-tests-sol-honk:
needs: [noir-build-acir-tests, build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.barretenberg == 'true' || needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: barretenberg-acir-tests-sol-honk-x86
- name: "BB Solidity Acir Tests"
working-directory: ./barretenberg/
timeout-minutes: 40
run: earthly-ci --no-output ./+barretenberg-acir-tests-sol-honk
bb-acir-tests-bb-js:
needs: [noir-build-acir-tests, build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.barretenberg == 'true' || needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: barretenberg-acir-tests-bb-js-x86
- name: "BB JS Acir Tests"
working-directory: ./barretenberg/
timeout-minutes: 40
run: earthly-ci --no-output ./+barretenberg-acir-tests-bb.js
noir-format:
needs: [build-images, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.noir == 'true' || needs.configure.outputs.noir-projects == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: noir-format-x86
- name: "Format Noir"
working-directory: ./noir/
timeout-minutes: 40
run: earthly-ci --no-output ./+format
- name: "Format noir-projects"
working-directory: ./noir-projects/
timeout-minutes: 40
run: |
earthly-ci --no-output ./+format
noir-test:
needs: [build-images, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: noir-x86
- name: "Test Nargo"
run: earthly-ci --no-output ./noir+test
noir-examples:
# We delay this job until after the `build` job has completed as it depends on bb being built.
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: noir-examples-x86
- name: "Test Noir examples"
run: earthly-ci --no-output ./noir+examples
noir-packages-test:
# We delay this job until after the `build` job has completed as it depends on bb.js being built.
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.barretenberg == 'true' || needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: noir-packages-x86
- name: "Test Noir JS packages"
timeout-minutes: 50
run: earthly-ci --no-output ./noir+packages-test
noir-projects:
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.noir == 'true' || needs.configure.outputs.noir-projects == 'true' || needs.configure.outputs.txe == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: noir-projects-x86
- name: "Noir Projects"
timeout-minutes: 40
run: |
earthly-ci --no-output ./noir-projects/+test --RAYON_NUM_THREADS=$(nproc)
avm-format:
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.avm-transpiler == 'true' || needs.configure.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: avm-transpiler-format-x86
- name: "Format AVM transpiler"
working-directory: ./avm-transpiler/
timeout-minutes: 40
run: earthly-ci --no-output ./+format
yarn-project-formatting:
needs: [build, configure]
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
runs-on: ${{ needs.configure.outputs.username }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: yarn-project-formatting-x86
- name: "Yarn Project Tests"
timeout-minutes: 40
run: earthly-ci --no-output ./yarn-project/+format-check
yarn-project-test:
needs: [build, configure]
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
runs-on: ${{ needs.configure.outputs.username }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: yarn-project-test-x86
- name: "Yarn Project Tests"
timeout-minutes: 40
run: earthly-ci --no-output ./yarn-project/+test
prover-client-test:
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: prover-client-test-x86
- name: "Prover Client Tests"
timeout-minutes: 40
run: earthly-ci --no-output ./yarn-project/+prover-client-test
# proving disabled
network-test:
needs: [build, configure]
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
runs-on: ${{ needs.configure.outputs.username }}-x86
strategy:
max-parallel: 1
fail-fast: false
matrix:
test: [test-transfer.sh, test-4epochs.sh]
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: network-test-${{ matrix.test }}
- name: "Setup and Local Network Tests"
timeout-minutes: 60
# Only allow transfer test to run on every (non-network-all) PR
if: matrix.test == 'test-transfer.sh' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all')
run: sudo shutdown -P 60 ; earthly-ci --no-output ./yarn-project/+network-test --test=./${{ matrix.test }}
kind-smoke-test:
needs: [build, configure]
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
runs-on: ${{ needs.configure.outputs.username }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: kind-smoke-test
- name: Setup and KIND Network Test
timeout-minutes: 60
uses: ./.github/ensure-tester-with-images
env:
USERNAME: ${{ needs.configure.outputs.username }}
with:
runner_type: 8core-tester-x86
spot_strategy: None # use on-demand machines
builder_type: builder-x86
# these are copied to the tester and expected by the earthly command below
# if they fail to copy, it will try to build them on the tester and fail
builder_images_to_copy: aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
# command to produce the images in case they don't exist
builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images
tester_ttl: 60
run: |
cd yarn-project/end-to-end
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=default.yaml ./scripts/network_test.sh ./src/spartan/smoke.test.ts
# note: proving disabled
kind-network-test:
needs: [build, configure]
if: contains(github.event.pull_request.labels.*.name, 'network-all') || (needs.configure.outputs.yarn-project == 'true' && github.ref_name == 'master')
runs-on: ${{ needs.configure.outputs.username }}-x86
strategy:
fail-fast: false
matrix:
config:
- test: transfer.test.ts
values: 16-validators
runner_type: 16core-tester-x86
timeout: 60
# TODO: Enable this once stable
# - test: transfer.test.ts
# values: 48-validators
# runner_type: 32core-tester-x86
# timeout: 90
- 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 }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: kind-network-${{ matrix.config.test }}
- name: Setup and KIND Network Test
timeout-minutes: ${{ matrix.config.timeout }}
uses: ./.github/ensure-tester-with-images
env:
USERNAME: ${{ needs.configure.outputs.username }}
with:
runner_type: ${{ matrix.config.runner_type }}
spot_strategy: None # use on-demand machines
builder_type: builder-x86
# these are copied to the tester and expected by the earthly command below
# if they fail to copy, it will try to build them on the tester and fail
builder_images_to_copy: aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
# command to produce the images in case they don't exist
builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images
tester_ttl: ${{ matrix.config.timeout }}
run: |
cd yarn-project/end-to-end
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
test=${{ matrix.config.test }}
NAMESPACE="${test%.test.ts}" FRESH_INSTALL=true VALUES_FILE=${{ matrix.config.values }}.yaml ./scripts/network_test.sh ./src/spartan/$test
- name: Copy Network Logs
if: always() # Run on failure too
run: copy_from_tester /home/ubuntu/run-${{ env.RUN_ID }}/yarn-project/end-to-end/scripts/network-test.log network-test.log
- name: Upload Network Logs
if: always() # Run on failure too
uses: actions/upload-artifact@v4
with:
name: kind-network-test-${{ matrix.config.values }}-${{ matrix.config.test }}.log
path: network-test.log
l1-contracts-test:
needs: [build-images, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.l1-contracts == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: l1-contracts-${{ needs.configure.outputs.username }}-x86
- name: "Test l1 contracts"
run: earthly-ci --no-output ./l1-contracts+test
docs-preview:
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.non-barretenberg-cpp == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: docs-preview-x86
- name: "Docs Preview"
timeout-minutes: 60
run: |
earthly-ci --no-output \
./docs/+deploy-preview --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 }}
bb-bench:
runs-on: ubuntu-20.04
needs: [build, configure]
if: needs.configure.outputs.barretenberg-cpp == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: Build Bench Binaries
uses: ./.github/ensure-builder
env:
USERNAME: ${{ needs.configure.outputs.username }}
with:
runner_type: builder-x86
run: |
set -eux
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
scripts/earthly-ci --push ./barretenberg/cpp/+bench-binaries
- name: Run Bench
uses: ./.github/ensure-tester
env:
USERNAME: ${{ needs.configure.outputs.username }}
timeout-minutes: 40
with:
runner_type: 16core-tester-x86
run: |
scripts/earthly-ci --artifact ./barretenberg/cpp/+bench/bench.json --bench_mode=cache
- name: Copy Bench.json
run: copy_from_tester /home/ubuntu/run-${{ env.RUN_ID }}/barretenberg/cpp/bench.json bench.json
# Utilize github-action-benchmark to automatically update the plots at
# https://aztecprotocol.github.io/aztec-packages/dev/bench/ with new benchmark data.
# This also creates an alert if benchmarks exceed the threshold specified below.
- 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
# Access token to deploy GitHub Pages branch
github-token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
# Push and deploy GitHub pages branch automatically
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: "105%" # alert if bench result is 1.05x worse
comment-on-alert: true
fail-on-alert: false
alert-comment-cc-users: "@ludamad @codygunton"
max-items-in-chart: 50
boxes:
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'boxes') || contains(github.event.pull_request.labels.*.name, 'e2e-all')
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: boxes
- name: Build
working-directory: ./boxes
timeout-minutes: 40
run: earthly-ci +export-boxes
boxes-test:
needs: [boxes, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
strategy:
fail-fast: false
matrix:
box: [vanilla, react]
# intermittent issues with firefox https://github.com/AztecProtocol/aztec-packages/issues/6676
# browser: [chromium, webkit, firefox]
browser: [chromium, webkit]
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
- uses: ./.github/ci-setup-action
with:
# must be globally unique for build x runner
concurrency_key: boxes-${{ needs.configure.outputs.username }}-x86-${{ matrix.box }}-${{ matrix.browser }}
- name: Box test
working-directory: ./boxes
timeout-minutes: 40
run: earthly-ci -P --no-output +test --box=${{ matrix.box }} --browser=${{ matrix.browser }} --mode=cache
protocol-circuits-gates-report:
needs: [build, configure]
if: needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-barretenberg-cpp == 'true'
runs-on: ${{ needs.configure.outputs.username }}-x86
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
concurrency_key: protocol-circuits-gates-report-x86
- name: "Noir Protocol Circuits Report"
working-directory: ./noir-projects/
timeout-minutes: 40
run: |
earthly-ci \
--artifact +gates-report/gates_report.json
mv gates_report.json ../protocol_circuits_report.json
- name: Compare gates reports
id: gates_diff
uses: vezenovm/noir-gates-diff@acf12797860f237117e15c0d6e08d64253af52b6
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
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: [build, configure]
if: needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-misc-ci == 'true'
runs-on: ${{ needs.configure.outputs.username }}-x86
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
concurrency_key: public-functions-size-report-x86
- name: "Aztec Public Functions Bytecode Size Report"
working-directory: ./noir-projects/
timeout-minutes: 40
run: |
earthly-ci \
--artifact +public-functions-report/public_functions_report.json
mv 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
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
with:
header: public_functions_size
# delete the comment in case changes no longer impact circuit sizes
delete: ${{ !steps.public_functions_sizes_diff.outputs.markdown }}
message: ${{ steps.public_functions_sizes_diff.outputs.markdown }}
merge-check:
runs-on: ubuntu-20.04
needs:
- setup
- configure
- build
- e2e
# - bench-e2e # non-blocking
# - acir-bench # non-blocking
# - bench-summary # non-blocking
- bb-gcc
- bb-native-tests
- bb-js-test
- noir-build-acir-tests
- bb-acir-tests-bb
- bb-acir-tests-bb-ultra-plonk
- bb-acir-tests-bb-ultra-honk
- bb-acir-tests-bb-mega-honk
- bb-acir-tests-sol
- bb-acir-tests-sol-honk
- bb-acir-tests-bb-js
- noir-format
- noir-test
- noir-examples
- noir-packages-test
- noir-projects
- avm-format
- yarn-project-formatting
- yarn-project-test
- prover-client-test
- network-test
- kind-smoke-test
- kind-network-test
- l1-contracts-test
- docs-preview
# - bb-bench # non-blocking
- boxes
- boxes-test
# - protocol-circuits-gates-report # non-blocking
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