Skip to content

Commit

Permalink
ci: add circuit tests to workflows
Browse files Browse the repository at this point in the history
re #357
  • Loading branch information
cedoor committed Jan 9, 2024
1 parent 3b76ac8 commit 4f34342
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: "18"

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down Expand Up @@ -54,6 +54,7 @@ jobs:
strategy:
matrix:
type:
- circuits
- libraries
- contracts

Expand All @@ -63,7 +64,14 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: "18"

# https://github.com/iden3/circuits/blob/8fffb6609ecad0b7bcda19bb908bdb544bdb3cf7/.github/workflows/main.yml#L18-L22
- name: Setup Circom deps
run: sudo apt-get update && sudo apt-get install -y wget nlohmann-json3-dev libgmp-dev nasm g++ build-essential

- name: Setup Circom
run: wget https://github.com/iden3/circom/releases/latest/download/circom-linux-amd64 && sudo mv ./circom-linux-amd64 /usr/bin/circom && sudo chmod +x /usr/bin/circom

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand All @@ -84,10 +92,11 @@ jobs:
- name: Build libraries
run: yarn build:libraries

- name: Test contracts and libraries
- name: Test libraries, contracts and circuits
run: yarn test:${{ matrix.type }}

- name: Coveralls
if: matrix.type != 'circuits'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: "18"

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down Expand Up @@ -56,7 +56,14 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: "18"

# https://github.com/iden3/circuits/blob/8fffb6609ecad0b7bcda19bb908bdb544bdb3cf7/.github/workflows/main.yml#L18-L22
- name: Setup Circom deps
run: sudo apt-get update && sudo apt-get install -y wget nlohmann-json3-dev libgmp-dev nasm g++ build-essential

- name: Setup Circom
run: wget https://github.com/iden3/circom/releases/latest/download/circom-linux-amd64 && sudo mv ./circom-linux-amd64 /usr/bin/circom && sudo chmod +x /usr/bin/circom

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand All @@ -77,5 +84,5 @@ jobs:
- name: Build libraries
run: yarn build:libraries

- name: Test contracts and libraries
- name: Test contracts, libraries and circuits
run: yarn test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"compile:contracts": "yarn workspace contracts compile",
"download:snark-artifacts": "rimraf snark-artifacts && ts-node scripts/download-snark-artifacts.ts",
"remove:template-files": "ts-node scripts/remove-template-files.ts",
"test": "yarn test:libraries && yarn test:contracts",
"test": "yarn test:libraries && yarn test:contracts && yarn test:circuits",
"test:libraries": "jest --coverage",
"test:contracts": "yarn workspace contracts test:coverage",
"test:circuits": "yarn workspace @semaphore-protocol/circuits test",
Expand Down

0 comments on commit 4f34342

Please sign in to comment.