Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github actions for circuit builds and e2e tests #30

Merged
merged 30 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3d224ff
Add e2e test with circuit builds and proving keys generation
jimthematrix Aug 6, 2024
141c75e
Allow dead code parameter for cargo build
jimthematrix Aug 6, 2024
478dbbd
Update cargo install path
jimthematrix Aug 6, 2024
05724c1
Allow dead code in the cargo install step too
jimthematrix Aug 6, 2024
c874c3e
Remove cache settings for setup-node
jimthematrix Aug 6, 2024
6644ceb
Reorder checkout steps
jimthematrix Aug 6, 2024
109591c
Separate checkout and build circuits steps
jimthematrix Aug 6, 2024
626ec3a
Add missing 'npm install'
jimthematrix Aug 6, 2024
a1fa08d
Add missing env vars
jimthematrix Aug 6, 2024
efc2d8b
Add golang e2e step
jimthematrix Aug 6, 2024
a72ae7b
Fix CIRCUIT_ROOT path
jimthematrix Aug 6, 2024
1663a5d
Create integration test for circuits under 'js'
jimthematrix Aug 6, 2024
9a80cf7
Add circuit unit test action
jimthematrix Aug 6, 2024
cc3401e
Add circom release install to circuit unit tests build
jimthematrix Aug 6, 2024
526c3fe
Set circom release version
jimthematrix Aug 6, 2024
71f294a
Fix release install action syntax
jimthematrix Aug 6, 2024
a988275
Fix release install action syntax
jimthematrix Aug 6, 2024
ed1ac16
Fix release install action syntax
jimthematrix Aug 6, 2024
8061b4f
Add step to install circuit dependencies
jimthematrix Aug 6, 2024
5c98ee1
Install circom in e2e with the release binary
jimthematrix Aug 6, 2024
3af2958
Fix golang e2e test setup
jimthematrix Aug 6, 2024
c707e89
Add unit tests to golang sdk
jimthematrix Aug 6, 2024
0db7b57
Merge branch 'kyc' into gh-actions
jimthematrix Aug 7, 2024
0d5f6ad
Remove unneeded test
jimthematrix Aug 7, 2024
1d6ef94
Add js and solidity e2e tests
jimthematrix Aug 7, 2024
4f0d894
Update e2e test action
jimthematrix Aug 7, 2024
d8bdf1c
Update e2e test action
jimthematrix Aug 7, 2024
29c20df
Add postgres service for the e2e test
jimthematrix Aug 7, 2024
e7de950
Merge remote-tracking branch 'hl/main' into gh-actions
jimthematrix Aug 7, 2024
34b0372
Merge branch 'main' into gh-actions
jimthematrix Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/circuit-unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Circuit Unit Tests

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
circuit-unit-tests:
runs-on: ubuntu-latest
steps:
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install circom
uses: supplypike/setup-bin@v4
with:
uri: https://github.com/iden3/circom/releases/download/v2.1.9/circom-linux-amd64
name: circom
version: 2.1.9

- name: Checkout circuits
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install circuit dependencies
working-directory: zkp/circuits
run: |
npm install

- name: Run circuit unit tests
working-directory: zkp/js
run: |
npm install
npm t
86 changes: 86 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: e2e

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
integration-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: my-secret
POSTGRES_USER: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Install circom
uses: supplypike/setup-bin@v4
with:
uri: https://github.com/iden3/circom/releases/download/v2.1.9/circom-linux-amd64
name: circom
version: 2.1.9

- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: install snarkjs
run: |
npm install -g snarkjs

- name: Checkout circuits
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup temp dir for the artifacts
run: |
mkdir -p ${{ runner.temp }}/zeto-artifacts

- name: Build circuits
env:
PROVING_KEYS_ROOT: ${{ runner.temp }}/zeto-artifacts
PTAU_DOWNLOAD_PATH: ${{ runner.temp }}/zeto-artifacts
working-directory: zkp/circuits
run: |
npm install
npm run gen

- name: Run golang e2e tests
env:
PROVING_KEYS_ROOT: ${{ runner.temp }}/zeto-artifacts
CIRCUITS_ROOT: ${{ github.workspace }}/zkp/js/lib
working-directory: zkp/golang
run: |
make e2e

- name: Run js e2e tests
env:
PROVING_KEYS_ROOT: ${{ runner.temp }}/zeto-artifacts
CIRCUITS_ROOT: ${{ github.workspace }}/zkp/js/lib
working-directory: zkp/js
run: |
npm install
npm run test:e2e

- name: Run Zeto Tokens hardhat tests
env:
PROVING_KEYS_ROOT: ${{ runner.temp }}/zeto-artifacts
CIRCUITS_ROOT: ${{ github.workspace }}/zkp/js/lib
working-directory: solidity
run: |
npm install
npm t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

jobs:
build:
golang-test:
env:
TEST_ARGS: -v
runs-on: ubuntu-latest
Expand Down
170 changes: 0 additions & 170 deletions solidity/contracts/lib/verifier_check_smt_proof.sol

This file was deleted.

10 changes: 5 additions & 5 deletions zkp/golang/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ require (
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
)

Expand All @@ -46,8 +46,8 @@ require (
github.com/iden3/go-rapidsnark/types v0.0.2 // indirect
github.com/iden3/go-rapidsnark/witness/v2 v2.0.0
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/sys v0.23.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/driver/postgres v1.5.9
gorm.io/driver/sqlite v1.5.6
Expand Down
10 changes: 10 additions & 0 deletions zkp/golang/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,29 @@ github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJ
github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE=
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk=
golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down
Loading
Loading