Skip to content

Commit

Permalink
Merge pull request #804 from privacy-scaling-explorations/pbuild
Browse files Browse the repository at this point in the history
ci: nightly proving key generation workflow
  • Loading branch information
baumstern authored Nov 21, 2023
2 parents 5aa400f + df627ab commit 1148263
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 102 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/circuit-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,26 @@ name: Circuit

on:
push:
branches: [ master, audit, dev ]
branches: [ master, dev ]
pull_request:


concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
node-version: [18]


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 20
cache: 'npm'

- name: Update npm to latest version
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/contracts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,26 @@ name: Contracts

on:
push:
branches: [ master, audit, dev ]
branches: [ master, dev ]
pull_request:


concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node-version: [18]
runs-on: ubuntu-22.04


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 20
cache: 'npm'

- name: Update npm to latest version
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/core-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,26 @@ name: Core

on:
push:
branches: [ master, audit, dev ]
branches: [ master, dev ]
pull_request:


concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node-version: [18]
runs-on: ubuntu-22.04


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 20
cache: 'npm'

- name: Update npm to latest version
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/crypto-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,26 @@ name: Crypto

on:
push:
branches: [ master, audit, dev ]
branches: [ master, dev ]
pull_request:


concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node-version: [18]
runs-on: ubuntu-22.04


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 20
cache: 'npm'

- name: Update npm to latest version
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/domainobjs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,26 @@ name: Domainobjs

on:
push:
branches: [ master, audit, dev ]
branches: [ master, dev ]
pull_request:


concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node-version: [18]
runs-on: ubuntu-22.04


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 20
cache: 'npm'

- name: Update npm to latest version
Expand Down
26 changes: 6 additions & 20 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ name: CI

on:
push:
branches: [ master, audit, dev ]
branches: [ master, dev ]
pull_request:
schedule:
- cron: 0 0 * * *

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -19,29 +17,17 @@ jobs:
npm-publish:
needs: e2e
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
registry-url: 'https://registry.npmjs.org'

# To prevent `npm install` failure of circuit package,
# it has to checkout manually because version of `circomlib` has pinned to a specific commit
- name: Checkout circomlib
run: |
git init circuits/node_modules/circomlib
cd circuits/node_modules/circomlib
git remote add origin https://github.com/weijiekoh/circomlib
git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin ac85e82c1914d47789e2032fb11ceb2cfdd38a2b
git checkout --progress --force ac85e82c1914d47789e2032fb11ceb2cfdd38a2b
rm -rf ./.git
- name: Initialize Project
run: |
npm install
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: GitHub Pages

on:
push:
branches: [ master, audit, dev ]
branches: [ master, dev ]
pull_request:

concurrency:
Expand All @@ -12,10 +12,10 @@ concurrency:
jobs:

publish:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
Expand Down
114 changes: 114 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Nightly

on:
schedule:
- cron: 0 0 * * *


jobs:
generate-proving-keys:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
ref: dev

- name: Use Node.js 16
uses: actions/setup-node@v4
with:
node-version: 16

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes \
build-essential \
libgmp-dev \
libsodium-dev \
nasm \
nlohmann-json3-dev
- name: Initialize Project
run: |
npm install
npm run bootstrap
npm run build
- name: Compile Contracts
run: |
cd contracts
npm run compileSol
- name: Download rapidsnark (1c137)
run: |
mkdir -p ~/rapidsnark/build
wget -qO ~/rapidsnark/build/prover https://maci-devops-zkeys.s3.ap-northeast-2.amazonaws.com/rapidsnark-linux-amd64-1c137
chmod +x ~/rapidsnark/build/prover
- name: Download circom Binary v2.1.6
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.1.6/circom-linux-amd64
chmod +x /home/runner/work/maci/.local/bin/circom
- name: Generate zkeys
run: |
cd cli
mkdir -p zkeys
wget -qO zkeys/powersOfTau28_hez_final_20.ptau https://maci-devops-zkeys.s3.ap-northeast-2.amazonaws.com/powersOfTau28_hez_final_20.ptau
npx zkey-manager compile -c ./zkeys.config.yml
npx zkey-manager genZkeys -c ./zkeys.config.yml
- name: Start Hardhat
run: |
cd contracts
nohup npm run hardhat > /dev/null 2>&1 &
while [[ "$(lsof -i :8545)" -eq '0' ]]; do sleep 1; done
- name: Bespoke Test
run: ./.github/scripts/run-e2e-tests.sh

- name: Integration Test
run: |
cd integrationTests
npm run test
- name: Stop Hardhat
run: kill $(lsof -t -i:8545)

unit:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
node-version: [ 18, 20 ]

steps:
- uses: actions/checkout@v4
with:
ref: dev

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Update npm to latest version
run: npm install --global npm@latest

- name: Download circom Binary v2.1.6
run: |
wget -qO ${{ github.workspace }}/circom https://github.com/iden3/circom/releases/download/v2.1.6/circom-linux-amd64
chmod +x ${{ github.workspace }}/circom
sudo mv ${{ github.workspace }}/circom /bin/circom
- name: Build
run: |
npm install
npm run bootstrap
npm run build
- name: Test
run: npm run test
Loading

0 comments on commit 1148263

Please sign in to comment.