Skip to content

chore: e2e

chore: e2e #100

Workflow file for this run

name: E2E Tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: E2E Tests
runs-on: ubuntu-latest
environment: CI
env:
ETHEREUM_JSON_RPC_API_URL: ${{ secrets.ETHEREUM_JSON_RPC_API_URL }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: "20.x"
- name: Enable Corepack and Install Yarn 4
run: |
corepack enable
yarn set version latest
- name: Install Dependencies
run: yarn install
- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 1.0.0-beta.18
- name: Compile Circuit
run: nargo compile --workspace --skip-brillig-constraints-check
- name: Start Oracle Server
working-directory: ethereum/oracles
run: |
yarn oracle-server &
ORACLE_SERVER_PID=$!
echo "ORACLE_SERVER_PID=$ORACLE_SERVER_PID" >> $GITHUB_ENV
- name: Install Barretenberg
run: |
curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/next/barretenberg/bbup/install | bash
~/.bb/bbup -nv 1.0.0-beta.18
sudo apt install libc++-dev
- name: Generate Witnesses
run: |
nargo execute --package get_header --oracle-resolver=http://localhost:5555 --skip-brillig-constraints-check
nargo execute --package get_account --oracle-resolver=http://localhost:5555 --skip-brillig-constraints-check
nargo execute --package get_storage --oracle-resolver=http://localhost:5555 --skip-brillig-constraints-check
nargo execute --package get_receipt --oracle-resolver=http://localhost:5555 --skip-brillig-constraints-check
nargo execute --package get_transaction --oracle-resolver=http://localhost:5555 --skip-brillig-constraints-check
nargo execute --package get_log --oracle-resolver=http://localhost:5555 --skip-brillig-constraints-check
- name: Generate Proofs
run: |
export PATH="$HOME/.bb:$PATH"
mkdir -p proofs
bb prove -b ./target/get_header.json -w ./target/get_header.gz --write_vk -o ./proofs/get_header
bb prove -b ./target/get_account.json -w ./target/get_account.gz --write_vk -o ./proofs/get_account
bb prove -b ./target/get_storage.json -w ./target/get_storage.gz --write_vk -o ./proofs/get_storage
bb prove -b ./target/get_receipt.json -w ./target/get_receipt.gz --write_vk -o ./proofs/get_receipt
bb prove -b ./target/get_transaction.json -w ./target/get_transaction.gz --write_vk -o ./proofs/get_transaction
bb prove -b ./target/get_log.json -w ./target/get_log.gz --write_vk -o ./proofs/get_log
# Note: Solidity verifiers are pre-generated and committed to ethereum/contracts/src/generated-verifier/
# Generating them in CI causes OOM errors due to high memory requirements
# To regenerate: bb write_solidity_verifier -k ./target/get_header -o ./ethereum/contracts/src/generated-verifier/GetHeaderUltraPLONKVerifier.sol
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Compile Smart Contract
working-directory: ethereum/contracts
run: |
forge build || (test -f out/GetAccountUltraPLONKVerifier.sol/UltraVerifier.json && echo "Contracts compiled successfully despite size warnings" || exit 1)
- name: Run TypeScript Build
run: yarn build
- name: Run Unit Tests
working-directory: ethereum/oracles
run: yarn test:unit
- name: Run e2e Tests
working-directory: ethereum/tests
run: yarn test:e2e
- name: Stop Oracle Server
if: always()
run: kill $ORACLE_SERVER_PID