From c584fc1288b3b976858e158f5772277a5cf6a7ab Mon Sep 17 00:00:00 2001 From: arnau <17317030+arnaucube@users.noreply.github.com> Date: Sat, 11 Apr 2020 20:57:25 +0200 Subject: [PATCH 1/2] Create main.yml --- .github/workflows/main.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..259ca1f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,20 @@ + +name: Test +on: [push, pull_request] +jobs: + test: + # matrix strategy from: https://github.com/mvdan/github-actions-golang/blob/master/.github/workflows/test.yml + strategy: + matrix: + go-version: [1.13.x, 1.14.x] + platform: [ubuntu-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Test + run: go test ./... From 8df45c7a91261837a4d6efdd7a5cdd769013f9a7 Mon Sep 17 00:00:00 2001 From: arnaucube Date: Sat, 11 Apr 2020 21:11:31 +0200 Subject: [PATCH 2/2] Update compile-circuits.sh to adapt null from json, update GH Actions to install snarkjs & circom for testdata generation --- .github/workflows/main.yml | 14 ++++++++++++-- compile-circuits.sh | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 259ca1f..e482efb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,17 @@ jobs: uses: actions/setup-go@v1 with: go-version: ${{ matrix.go-version }} + - name: Install Nodejs + uses: actions/setup-node@v1 + with: + go-version: 10.x + - name: Install circom + run: npm install -g circom + - name: Install snarkjs + run: npm install -g snarkjs - name: Checkout code uses: actions/checkout@v2 - - name: Test - run: go test ./... + - name: Compile circuits and execute Go tests + run: | + sh ./compile-circuits.sh + go test ./... diff --git a/compile-circuits.sh b/compile-circuits.sh index dbc903a..405534a 100755 --- a/compile-circuits.sh +++ b/compile-circuits.sh @@ -6,6 +6,7 @@ echo "compiling circuit" circom circuit.circom -r1cs --wasm --sym echo "generating setup" snarkjs setup +sed -i 's/null/["0","0","0"]/g' proving_key.json echo "calculating witness" snarkjs calculatewitness --wasm circuit.wasm --input input.json --witness witness.json @@ -15,5 +16,6 @@ echo "compiling circuit" circom circuit.circom -r1cs --wasm --sym echo "generating setup" snarkjs setup +sed -i 's/null/["0","0","0"]/g' proving_key.json echo "calculating witness" snarkjs calculatewitness --wasm circuit.wasm --input input.json --witness witness.json