10
10
11
11
jobs :
12
12
13
- build-linux :
14
- runs-on : ubuntu-22 .04
13
+ build-linux-x86_64 :
14
+ runs-on : ubuntu-24 .04
15
15
steps :
16
16
- uses : actions/checkout@v4
17
17
with :
@@ -21,38 +21,15 @@ jobs:
21
21
uses : awalsh128/cache-apt-pkgs-action@v1
22
22
with :
23
23
packages : build-essential cmake m4 nasm
24
- version : 1.0
25
-
26
- - name : Setup QEMU to build ARM64 variant
27
- uses : docker/setup-qemu-action@v3
28
-
29
- - name : Setup buildx for ARM64 platform
30
- uses : docker/setup-buildx-action@v3
31
- with :
32
- platforms : linux/amd64,linux/arm64
33
-
34
- - name : Prepare Docker image builder for ARM64
35
- uses : docker/build-push-action@v6
36
- env :
37
- DOCKER_BUILD_SUMMARY : false
38
- DOCKER_BUILD_RECORD_UPLOAD : false
39
- with :
40
- push : false
41
- outputs : type=docker
42
- platforms : linux/arm64
43
- file : .github/images/Dockerfile.build
44
- context : ./.github/images/context.build
45
- cache-from : type=gha,scope=buildkit-arm64
46
- cache-to : type=gha,mode=max,scope=buildkit-arm64
47
- tags : builder:arm64
24
+ version : x86_64-1.0
48
25
49
26
- name : Cache gmp build
50
27
uses : actions/cache@v4
51
28
with :
52
29
path : |
53
30
depends/gmp
54
31
depends/gmp-6.2.1.tar.xz
55
- key : ${{ runner.os }}-gmp-${{ hashFiles('build_gmp.sh') }}-4
32
+ key : ${{ runner.os }}-${{ runner.arch }}- gmp-${{ hashFiles('build_gmp.sh') }}
56
33
57
34
- name : Build gmp for Android arm64
58
35
run : if [[ ! -d "depends/gmp/package_android_arm64" ]]; then ./build_gmp.sh android; fi
63
40
- name : Build gmp for Linux x86_64
64
41
run : if [[ ! -d "depends/gmp/package" ]]; then ./build_gmp.sh host; fi
65
42
66
- - name : Build gmp for Linux arm64
67
- run : |
68
- if [[ ! -d "depends/gmp/package_aarch64" ]]; then
69
- docker run --rm --platform=linux/arm64 -i -v $PWD:/work --workdir=/work builder:arm64 ./build_gmp.sh aarch64
70
- fi
71
-
72
43
- name : Build prover Android ARM64
73
44
run : |
74
45
make android
95
66
make host_noasm
96
67
ctest --rerun-failed --output-on-failure
97
68
98
- - name : Build prover Linux arm64
99
- run : |
100
- docker run --rm --platform=linux/arm64 -i -v $PWD:/work --workdir=/work builder:arm64 bash -c "$(cat << 'EOF'
101
- set -x
102
- set -e
103
- make arm64
104
- ctest --rerun-failed --output-on-failure
105
- EOF
106
- )"
107
-
108
69
- name : Test rapidsnark
109
70
run : |
110
71
set -x
@@ -137,15 +98,6 @@ jobs:
137
98
package_noasm
138
99
if-no-files-found : error
139
100
140
- - name : Upload Linux arm64 dev artifacts
141
- if : github.event_name != 'release'
142
- uses : actions/upload-artifact@v4
143
- with :
144
- name : rapidsnark-linux-arm64
145
- path : |
146
- package_arm64
147
- if-no-files-found : error
148
-
149
101
- name : Upload Android dev artifacts
150
102
if : github.event_name != 'release'
151
103
uses : actions/upload-artifact@v4
@@ -226,6 +178,58 @@ jobs:
226
178
zip -r rapidsnark-linux-x86_64-noasm-${{ github.ref_name }}.zip rapidsnark-linux-x86_64-noasm-${{ github.ref_name }}
227
179
gh release upload ${{ github.event.release.tag_name }} rapidsnark-linux-x86_64-noasm-${{ github.ref_name }}.zip
228
180
181
+ build-linux-arm64 :
182
+ runs-on : ubuntu-24.04-arm
183
+ steps :
184
+ - uses : actions/checkout@v4
185
+ with :
186
+ submodules : " recursive"
187
+
188
+ - name : install requirements
189
+ uses : awalsh128/cache-apt-pkgs-action@v1
190
+ with :
191
+ packages : build-essential cmake m4 nasm
192
+ version : arm64-1.0
193
+
194
+ - name : Cache gmp build
195
+ uses : actions/cache@v4
196
+ with :
197
+ path : |
198
+ depends/gmp
199
+ depends/gmp-6.2.1.tar.xz
200
+ key : ${{ runner.os }}-${{ runner.arch }}-gmp-${{ hashFiles('build_gmp.sh') }}
201
+
202
+ - name : Build gmp for Linux arm64
203
+ run : if [[ ! -d "depends/gmp/package_aarch64" ]]; then ./build_gmp.sh aarch64; fi
204
+
205
+ - name : Build prover Linux arm64
206
+ run : |
207
+ make host_arm64
208
+ ctest --rerun-failed --output-on-failure
209
+
210
+ - name : Test rapidsnark
211
+ run : |
212
+ set -x
213
+ set -e
214
+ time package_arm64/bin/prover testdata/circuit_final.zkey testdata/witness.wtns proof.json public.json
215
+ time package_arm64/bin/verifier testdata/verification_key.json public.json proof.json
216
+ # make a wrong public.json by decrementing the first element by 1
217
+ (value_0=$(jq '.[0]' public.json | tr -d '"') && value_0=$(echo "$value_0 - 1" | BC_LINE_LENGTH=100 bc) && jq --arg value_0 "$value_0" '.[0] = $value_0' public.json) > public_bad.json
218
+ set +e
219
+ time package_arm64/bin/verifier testdata/verification_key.json public_bad.json proof.json
220
+ exit_code=$?
221
+ set -e
222
+ [ $exit_code -ne 0 ]
223
+
224
+ - name : Upload Linux arm64 dev artifacts
225
+ if : github.event_name != 'release'
226
+ uses : actions/upload-artifact@v4
227
+ with :
228
+ name : rapidsnark-linux-arm64
229
+ path : |
230
+ package_arm64
231
+ if-no-files-found : error
232
+
229
233
- name : Upload Linux ARM64 release artifacts
230
234
if : github.event_name == 'release'
231
235
env :
@@ -250,18 +254,15 @@ jobs:
250
254
path : |
251
255
depends/gmp
252
256
depends/gmp-6.2.1.tar.xz
253
- key : ${{ runner.os }}-gmp-arm64 -${{ hashFiles('build_gmp.sh') }}
257
+ key : ${{ runner.os }}-${{ runner.arch }}-gmp -${{ hashFiles('build_gmp.sh') }}
254
258
255
259
- name : build
256
260
run : |
257
261
if [[ ! -d "depends/gmp/package_ios_arm64" ]]; then ./build_gmp.sh ios; fi
258
262
if [[ ! -d "depends/gmp/package_iphone_simulator" ]]; then ./build_gmp.sh ios_simulator; fi
259
263
if [[ ! -d "depends/gmp/package_macos_arm64" ]]; then ./build_gmp.sh macos_arm64; fi
260
-
261
264
make ios
262
-
263
265
make ios_simulator
264
-
265
266
make macos_arm64
266
267
ctest --rerun-failed --output-on-failure
267
268
@@ -352,7 +353,7 @@ jobs:
352
353
path : |
353
354
depends/gmp
354
355
depends/gmp-6.2.1.tar.xz
355
- key : ${{ runner.os }}-gmp-x86_64- ${{ hashFiles('build_gmp.sh') }}-2
356
+ key : ${{ runner.os }}-${{ runner.arch }}- gmp-${{ hashFiles('build_gmp.sh') }}
356
357
357
358
- name : install dependencies
358
359
run : |
@@ -361,7 +362,6 @@ jobs:
361
362
- name : build
362
363
run : |
363
364
if [[ ! -d "depends/gmp/package_macos_x86_64" ]]; then ./build_gmp.sh macos_x86_64; fi
364
-
365
365
make macos_x86_64
366
366
ctest --rerun-failed --output-on-failure
367
367
0 commit comments