From c5eb273da4de3a4b049f8fc63942d37068bf11a8 Mon Sep 17 00:00:00 2001 From: poma Date: Wed, 16 Jun 2021 15:20:16 +0300 Subject: [PATCH] enable tests in CI --- .github/workflows/build.yml | 22 +++++++++++----------- package.json | 1 + scripts/buildCircuit.sh | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e94b1aa..757d12a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,14 +17,14 @@ jobs: node-version: 14 - run: yarn install - run: yarn lint -# build is disabled until it's made non-interactive -# - run: yarn build -# - run: yarn test -# - name: Telegram Failure Notification -# uses: appleboy/telegram-action@0.0.7 -# if: failure() -# with: -# message: ❗ Build failed for [${{ github.repository }}](https://github.com/${{ github.repository }}/actions) because of ${{ github.actor }} -# format: markdown -# to: ${{ secrets.TELEGRAM_CHAT_ID }} -# token: ${{ secrets.TELEGRAM_BOT_TOKEN }} + - run: yarn download + - run: yarn build + - run: yarn test + - name: Telegram Failure Notification + uses: appleboy/telegram-action@0.0.7 + if: failure() + with: + message: ❗ Build failed for [${{ github.repository }}](https://github.com/${{ github.repository }}/actions) because of ${{ github.actor }} + format: markdown + to: ${{ secrets.TELEGRAM_CHAT_ID }} + token: ${{ secrets.TELEGRAM_BOT_TOKEN }} diff --git a/package.json b/package.json index c76ea58..5c87361 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "circuit": "./scripts/buildCircuit.sh 2 && ./scripts/buildCircuit.sh 16", "compile": "npx hardhat compile", "build": "npm run circuit && npm run compile", + "download": "curl https://github.com/tornadocash/tornado-pool/releases/download/tmp/ptau15 --create-dirs -o artifacts/circuits/ptau15", "test": "npx hardhat test", "eslint": "eslint --ext .js --ignore-path .gitignore .", "prettier:check": "prettier --check . --config .prettierrc", diff --git a/scripts/buildCircuit.sh b/scripts/buildCircuit.sh index a815ecd..ca8a3b8 100755 --- a/scripts/buildCircuit.sh +++ b/scripts/buildCircuit.sh @@ -10,7 +10,7 @@ if [ ! -f artifacts/circuits/ptau$POWERS_OF_TAU ]; then fi npx circom -v -r artifacts/circuits/transaction$1.r1cs -w artifacts/circuits/transaction$1.wasm -s artifacts/circuits/transaction$1.sym circuits/transaction$1.circom npx snarkjs groth16 setup artifacts/circuits/transaction$1.r1cs artifacts/circuits/ptau$POWERS_OF_TAU artifacts/circuits/tmp_transaction$1.zkey -npx snarkjs zkey contribute artifacts/circuits/tmp_transaction$1.zkey artifacts/circuits/transaction$1.zkey +echo "qwe" | npx snarkjs zkey contribute artifacts/circuits/tmp_transaction$1.zkey artifacts/circuits/transaction$1.zkey npx snarkjs zkey export solidityverifier artifacts/circuits/transaction$1.zkey artifacts/circuits/Verifier$1.sol sed -i.bak "s/contract Verifier/contract Verifier${1}/g" artifacts/circuits/Verifier$1.sol #zkutil setup -c artifacts/circuits/transaction$1.r1cs -p artifacts/circuits/transaction$1.params