Skip to content

Run solidity-example Tests on PR #160

Run solidity-example Tests on PR

Run solidity-example Tests on PR #160

# a github workflow that runs curl -L https://foundry.paradigm.xyz | bash then nargo codegen-verifier then nargo prove p
name: Run solidity-example Tests on PR
on:
pull_request:
paths:
- "solidity-example/**"
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
jobs:
test:
defaults:
run:
working-directory: solidity-example
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nargo
uses: noir-lang/noirup@v0.1.2
with:
toolchain: stable
- name: Run Noir unit tests
working-directory: solidity-example/circuits
run: |
nargo test
- name: Install bb
run: |
curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/next/barretenberg/bbup/install | bash
echo "PATH=$PATH:/home/runner/.bb" >> $GITHUB_ENV
- name: Run bbup
run: |
bbup
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Generate verifier contract
run: |
./build.sh
working-directory: solidity-example/circuits
- name: Install JS dependencies
working-directory: solidity-example/js
run: |
yarn install
- name: Generate proof in JS and test with Foundry
run: |
yarn generate-proof
cd ../contract && forge test --optimize --optimizer-runs 5000 --evm-version london
working-directory: solidity-example/js
- name: Generate CLI proof and test with Foundry
working-directory: solidity-example/circuits
run: |
nargo execute
bb prove -b ./target/noir_solidity.json -w target/noir_solidity.gz -o ./target --oracle_hash keccak
cd ..
(cd contract && forge test --optimize --optimizer-runs 5000 --gas-report -vvv)
- name: Run TypeScript tests with blockchain integration
run: |
yarn test
working-directory: solidity-example/js
- name: Create issue on failure (nightly)
if: failure() && github.event_name == 'schedule'
uses: actions/github-script@v6
with:
script: |
github.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: '[Nightly] Solidity-example workflow failed',
body: `The nightly Solidity-example workflow failed. Please investigate.\n\n/cc @noir-lang/developerrelations`,
labels: ['nightly', 'bug']
})