From 3b76c5ffb396dea6ee37559a23b08682f2638496 Mon Sep 17 00:00:00 2001 From: Saleel Date: Wed, 7 Feb 2024 04:25:41 +0530 Subject: [PATCH] add circuit test to github actios --- .circleci/config.yml | 44 ++++++++++++++++++------------------ .github/workflows/action.yml | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/action.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 72375e223..489824cf6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,22 +1,22 @@ -version: 2.1 -orbs: - node: circleci/node@5.1.0 - rust: circleci/rust@1.6.0 -jobs: - run_circuit_tests: - docker: - - image: saleel/circom:2.1.6 - steps: - - checkout: - path: ~/zk-email-verify - - node/install-packages: - pkg-manager: yarn - app-dir: ~/zk-email-verify - - run: - command: yarn test -w 2 - name: Run circom tests - working_directory: ~/zk-email-verify/packages/circuits -workflows: - build_test: - jobs: - - run_circuit_tests +# version: 2.1 +# orbs: +# node: circleci/node@5.1.0 +# rust: circleci/rust@1.6.0 +# jobs: +# run_circuit_tests: +# docker: +# - image: saleel/circom:2.1.6 +# steps: +# - checkout: +# path: ~/zk-email-verify +# - node/install-packages: +# pkg-manager: yarn +# app-dir: ~/zk-email-verify +# - run: +# command: yarn test -w 2 +# name: Run circom tests +# working_directory: ~/zk-email-verify/packages/circuits +# workflows: +# build_test: +# jobs: +# - run_circuit_tests diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml new file mode 100644 index 000000000..630193abe --- /dev/null +++ b/.github/workflows/action.yml @@ -0,0 +1,44 @@ +name: ZK Email tests +on: [push] +jobs: + run_circuit_tests: + runs-on: ubuntu-latest + environment: development + steps: + - uses: actions/checkout@v3 + + # Circom installation from https://github.com/erhant/circomkit/blob/main/.github/workflows/tests.yml + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install --yes \ + build-essential \ + libgmp-dev \ + libsodium-dev \ + nasm \ + nlohmann-json3-dev + + - name: Set Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Download Circom Binary v2.1.5 + run: | + wget -qO /home/runner/work/circom https://github.com/iden3/circom/releases/download/v2.1.5/circom-linux-amd64 + chmod +x /home/runner/work/circom + sudo mv /home/runner/work/circom /bin/circom + + - name: Print Circom version + run: circom --version + + - name: Install Yarn dependencies + working-directory: ./packages/circuits + run: yarn install --immutable + + - name: Run Tests + working-directory: ./packages/circuits + run: yarn test