ci: add circuit tests to workflows

re #357
This commit is contained in:
cedoor
2023-12-06 10:36:40 +00:00
parent 58cfdf7d6b
commit 875afb5383
3 changed files with 23 additions and 7 deletions

View File

@@ -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
@@ -90,6 +90,7 @@ jobs:
strategy:
matrix:
type:
- circuits
- libraries
- contracts
@@ -99,7 +100,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
@@ -120,10 +128,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 }}

View File

@@ -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
@@ -59,7 +59,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
@@ -83,5 +90,5 @@ jobs:
- name: Build subgraph
run: yarn build:subgraph
- name: Test contracts, libraries and subgraph
- name: Test contracts, libraries, circuits and subgraph
run: yarn test

View File

@@ -12,7 +12,7 @@
"compile:contracts": "yarn workspace semaphore-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 && yarn test:subgraph",
"test": "yarn test:libraries && yarn test:contracts && yarn test:circuits && yarn test:subgraph",
"test:libraries": "jest --coverage",
"test:subgraph": "yarn workspace semaphore-subgraph test",
"test:contracts": "yarn workspace semaphore-contracts test:coverage",