This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
forked from idyllicvision/rapidsnark
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from 0xPolygonID/cibuild
Cibuild
- Loading branch information
Showing
13 changed files
with
504 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- cibuild | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: install requirements | ||
uses: awalsh128/cache-apt-pkgs-action@v1 | ||
with: | ||
packages: curl xz-utils build-essential cmake m4 nasm | ||
version: 1.0 | ||
|
||
- name: Cache gmp build | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
depends/gmp | ||
depends/gmp-6.2.1.tar.xz | ||
key: ${{ runner.os }}-gmp-${{ hashFiles('build_gmp.sh') }}-2 | ||
|
||
- name: build gmp android arm64 | ||
run: if [[ ! -d "depends/gmp/package_android_arm64" ]]; then ./build_gmp.sh android; fi | ||
|
||
- name: build gmp android x86_64 | ||
run: if [[ ! -d "depends/gmp/package_android_x86_64" ]]; then ./build_gmp.sh android_x86_64; fi | ||
|
||
- name: build gmp android x86_64 | ||
run: if [[ ! -d "depends/gmp/package" ]]; then ./build_gmp.sh host; fi | ||
|
||
- name: Build prover Android ARM64 | ||
run: | | ||
mkdir build_prover_android && cd build_prover_android | ||
cmake .. -DTARGET_PLATFORM=ANDROID -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package_android | ||
make -j4 && make install | ||
- name: Build prover Android x86_64 | ||
run: | | ||
mkdir build_prover_android_x86_64 && cd build_prover_android_x86_64 | ||
cmake .. -DTARGET_PLATFORM=ANDROID_x86_64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package_android_x86_64 | ||
make -j4 && make install | ||
- name: Build prover Linux | ||
run: | | ||
mkdir build_prover && cd build_prover | ||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package | ||
make -j4 && make install | ||
- name: upload Android ARM64 artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rapidsnark-Android-arm64 | ||
path: | | ||
package_android | ||
if-no-files-found: error | ||
|
||
- name: upload Android x86_64 artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rapidsnark-Android-x86_64 | ||
path: | | ||
package_android_x86_64 | ||
if-no-files-found: error | ||
|
||
- name: upload Linux x86_64 artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rapidsnark-Linux-x86_64 | ||
path: | | ||
package | ||
if-no-files-found: error | ||
|
||
build-apple-arm64: | ||
runs-on: macos-13-xlarge | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: Cache gmp build | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
depends/gmp | ||
depends/gmp-6.2.1.tar.xz | ||
key: ${{ runner.os }}-gmp-arm64-${{ hashFiles('build_gmp.sh') }} | ||
|
||
- name: build | ||
run: | | ||
if [[ ! -d "depends/gmp/package_ios_arm64" ]]; then ./build_gmp.sh ios; fi | ||
if [[ ! -d "depends/gmp/package_iphone_simulator" ]]; then ./build_gmp.sh ios_simulator; fi | ||
if [[ ! -d "depends/gmp/package_macos_arm64" ]]; then ./build_gmp.sh macos_arm64; fi | ||
mkdir build_prover_ios && cd build_prover_ios | ||
cmake .. -GXcode -DTARGET_PLATFORM=IOS -DCMAKE_INSTALL_PREFIX=../package_ios | ||
xcodebuild -destination 'generic/platform=iOS' -scheme rapidsnarkStatic -project rapidsnark.xcodeproj -configuration Release | ||
cp ../depends/gmp/package_ios_arm64/lib/libgmp.a src/Release-iphoneos | ||
cd ../ | ||
mkdir build_prover_ios_simulator && cd build_prover_ios_simulator | ||
cmake .. -GXcode -DTARGET_PLATFORM=IOS -DCMAKE_INSTALL_PREFIX=../package_ios_simulator -DUSE_ASM=NO | ||
xcodebuild -destination 'generic/platform=iOS Simulator' -scheme rapidsnarkStatic -project rapidsnark.xcodeproj | ||
cp ../depends/gmp/package_iphone_simulator/lib/libgmp.a src/Debug-iphonesimulator | ||
cd ../ | ||
mkdir build_prover_macos_arm64 && cd build_prover_macos_arm64 | ||
cmake .. -DTARGET_PLATFORM=macos_arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package_macos_arm64 | ||
make -j4 && make install | ||
- name: test prover | ||
run: | | ||
set -x | ||
set -e | ||
npm install -g snarkjs | ||
package_macos_arm64/bin/prover testdata/circuit_final.zkey testdata/witness.wtns proof.json public.json | ||
snarkjs groth16 verify testdata/verification_key.json public.json proof.json | ||
- name: upload iOS artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rapidsnark-iOS | ||
path: | | ||
build_prover_ios/src/Release-iphoneos | ||
if-no-files-found: error | ||
|
||
- name: upload iOS Simulator artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rapidsnark-iOS-Simulator | ||
path: | | ||
build_prover_ios_simulator/src/Debug-iphonesimulator | ||
if-no-files-found: error | ||
|
||
- name: upload macOS arm64 artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rapidsnark-macOS-arm64 | ||
path: | | ||
package_macos_arm64 | ||
if-no-files-found: error | ||
|
||
build-apple-x86_64: | ||
runs-on: macos-13 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: Cache gmp build | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
depends/gmp | ||
depends/gmp-6.2.1.tar.xz | ||
key: ${{ runner.os }}-gmp-x86_64-${{ hashFiles('build_gmp.sh') }}-2 | ||
|
||
- name: install dependencies | ||
run: | | ||
brew install nasm | ||
- name: build | ||
run: | | ||
if [[ ! -d "depends/gmp/package_macos_x86_64" ]]; then ./build_gmp.sh macos_x86_64; fi | ||
mkdir build_prover_macos_x86_64 && cd build_prover_macos_x86_64 | ||
cmake .. -DTARGET_PLATFORM=macos_x86_64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package_macos_x86_64 | ||
make -j4 && make install | ||
- name: test prover | ||
run: | | ||
set -x | ||
set -e | ||
npm install -g snarkjs | ||
package_macos_x86_64/bin/prover testdata/circuit_final.zkey testdata/witness.wtns proof.json public.json | ||
snarkjs groth16 verify testdata/verification_key.json public.json proof.json | ||
- name: upload macOS x86_64 artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rapidsnark-macOS-x86_64 | ||
path: | | ||
package_macos_x86_64 | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,3 +75,5 @@ package* | |
|
||
build/fq_asm.o | ||
build/fr_asm.o | ||
|
||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.