Hardhat script tests #173
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Hardhat script tests | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'contracts/scripts/**' | |
- '.github/workflows/test-scripts.yml' | |
env: | |
NODE_VERSION: 20.x | |
ZKEYS_DOWNLOAD_SCRIPT: "download-6-9-2-3.sh" | |
PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }} | |
PINATA_SECRET_API_KEY: ${{ secrets.PINATA_SECRET_API_KEY }} | |
jobs: | |
script-tests: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Use Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install g++ library dependencies | |
run: | | |
sudo apt update | |
sudo apt-get install build-essential libgmp-dev libsodium-dev nlohmann-json3-dev nasm g++ curl | |
- name: Checkout rapidsnark source code | |
uses: actions/checkout@v3 | |
with: | |
repository: clrfund/rapidsnark | |
path: rapidsnark | |
- name: Install rapidsnark | |
run: | | |
cd $GITHUB_WORKSPACE/rapidsnark | |
npm install | |
git submodule init | |
git submodule update | |
./build_gmp.sh host | |
mkdir build_prover && cd build_prover | |
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package | |
make -j4 && make install | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
with: | |
path: monorepo | |
- name: Download circuit params | |
run: | | |
cd monorepo/contracts | |
../.github/scripts/${ZKEYS_DOWNLOAD_SCRIPT} | |
- name: Build CLR | |
run: | | |
cd monorepo | |
# use https to avoid error: unable to connect to github.com | |
git config --global url."https://".insteadOf git:// | |
yarn && yarn build | |
- name: Start hardhat network | |
run: | | |
cd monorepo | |
yarn start:node & | |
- name: Run script tests | |
run: | | |
export RAPID_SNARK=$GITHUB_WORKSPACE/rapidsnark/package/bin/prover | |
export CIRCUIT_DIRECTORY=$GITHUB_WORKSPACE/params | |
cd monorepo/contracts | |
./sh/runScriptTests.sh |