-
Notifications
You must be signed in to change notification settings - Fork 310
202 lines (182 loc) · 7.17 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
name: Earthly CI
on:
push:
branches: [master]
pull_request: {}
workflow_dispatch: {}
jobs:
# there's a lot of x86 tasks - let's split out the build step
build-x86:
runs-on: ubuntu-latest
outputs:
e2e_list: ${{ steps.e2e_list.outputs.list }}
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: build-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}-x86
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# we check out submodules in ci-setup-action
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup
uses: ./.github/ci-setup-action
with:
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
github_actor: ${{ github.actor }}
- name: Build
working-directory: ./yarn-project
run: |
# push to registry
earthly-cloud build x86 --push +build-end-to-end
# 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)
- id: e2e_list
working-directory: ./yarn-project/end-to-end
run: |
echo "list=$(earthly ls | grep -v '+base' | sed 's/+//' | jq -R . | jq -cs .)" >> $GITHUB_OUTPUT
# all the end-to-end integration tests for aztec
e2e-arm:
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
strategy:
fail-fast: false
matrix:
test:
- e2e-card-game
- e2e-crowdfunding-and-claim
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: ${{ matrix.test }}-${{ github.ref_name == 'master' && github.run_id|| github.ref_name }}-arm
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# we check out submodules in ci-setup-action
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup
uses: ./.github/ci-setup-action
with:
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
github_actor: ${{ github.actor }}
- name: Build
working-directory: ./yarn-project/end-to-end/
# We don't do much on arm, just run it on their builder
run:
# Flags:
# - e2e_mode=build to get images from a local build, not a dockerhub registry strategy
earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_mode=build
# all the end-to-end integration tests for aztec
e2e-x86:
needs: build-x86
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
strategy:
fail-fast: false
matrix:
test: ${{ fromJson( needs.build-x86.outputs.e2e_list )}}
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: ${{ matrix.test }}-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}-x86
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# we check out submodules in ci-setup-action
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup
uses: ./.github/ci-setup-action
with:
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
github_actor: ${{ github.actor }}
- name: Pull E2E Images
working-directory: ./barretenberg/cpp/
run: |
docker pull aztecprotocol/aztec-cache:$(git rev-parse HEAD)
docker pull aztecprotocol/end-to-end-cache:$(git rev-parse HEAD)
docker tag aztecprotocol/aztec-cache:$(git rev-parse HEAD) aztecprotocol/aztec:latest
docker tag aztecprotocol/end-to-end-cache:$(git rev-parse HEAD) aztecprotocol/end-to-end:latest
- name: Test
working-directory: ./yarn-project/end-to-end/
run: |
# we blank earthly token just to be sure this is a pure local run
EARTHLY_TOKEN="" earthly -P --no-output +${{ matrix.test }} --e2e_mode=cache
# barretenberg (prover) native tests
bb-native-tests:
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
strategy:
fail-fast: false
matrix:
environment: [x86]
# pending fix for intermittent test
# environment: [x86, arm]
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: bb-native-tests-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}-${{ matrix.environment }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# we check out submodules in ci-setup-action
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup
uses: ./.github/ci-setup-action
with:
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
github_actor: ${{ github.actor }}
- name: Test
working-directory: ./barretenberg/cpp/
run: |
earthly-cloud test ${{ matrix.environment }} --no-output +test
# All benchmarks, purposefully ran sequential on a machine
# they should use parallelism within the benchmark, but only one thing should run at a time
# for accurate results
# We don't depend on 'build' as we use a different runner and will build components on the fist step that uses them.
bench:
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
# We use a looser concurrency limit here, but we place a lock
# in the actual step action so that only one bench takes place
group: bench-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}-x86
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# we check out submodules in ci-setup-action
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup
uses: ./.github/ci-setup-action
with:
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
github_actor: ${{ github.actor }}
- name: Build and Push Binaries
working-directory: ./barretenberg/cpp/
run: earthly-cloud build x86 --push +bench-base
# Only allow one person to use this runner
# The reason is that as detailed in https://github.com/ben-z/gh-action-mutex
# things do not become 'pending' in github actions, and instead just cancel one another
- name: Set up mutex
uses: ben-z/[email protected]
with:
branch: gh-action-mutex-bench
# Use bench_mode=cache to read the pushed build above
- name: Client IVC Bench
working-directory: ./barretenberg/cpp/
run: earthly-cloud bench x86 --no-output +bench-client-ivc --bench_mode=cache
- name: Ultrahonk Bench
working-directory: ./barretenberg/cpp/
run: earthly-cloud bench x86 --no-output +bench-ultra-honk --bench_mode=cache