forked from privacy-scaling-explorations/maci
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (57 loc) · 2.02 KB
/
circuit-build.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
name: Circuit
on:
push:
branches: [ v1 ]
pull_request:
branches: [ v1 ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [14, 16]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Update npm to latest version
run: npm install --global npm@latest
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes \
build-essential \
libgmp-dev \
libsodium-dev \
nasm \
nlohmann-json3-dev
- name: Build
run: |
npm install
npm run bootstrap
npm run build
# Pinning to v2.0.7 dueto circom-helper fails when circom prints warnings; the new feature of v2.0.8
- name: Download circom Binary v2.0.7
run: |
mkdir -p /home/runner/work/maci/.local/bin
wget -qO /home/runner/work/maci/.local/bin/circom https://github.com/iden3/circom/releases/download/v2.0.7/circom-linux-amd64
chmod +x /home/runner/work/maci/.local/bin/circom
- name: Run circom-helper
run: |
# Prevent error `Error: ENOENT: no such file or directory, scandir '/home/ubuntu/maci/circuits/circom/prod/'`
# TODO: Add `./circom/prod/` to `circuitDirs` of `circuits/circomHelperConfig.json` when
# `circuits/scripts/buildCustomSnarks.sh` script executed
mkdir circom/prod
nohup npm run circom-helper &
# Wait until circom-helper listen to port 9001
while [[ "$(lsof -i :9001)" -eq '0' ]]; do sleep 1; done
working-directory: circuits
- name: Test
run: npm run test
working-directory: circuits