Skip to content

Commit b578caa

Browse files
committed
Add GitHub Actions workflow for recursive verification tests and update README
- Introduced a new workflow to automate recursive verification tests on push and pull request events. - Enhanced README with instructions for running tests and details on the CI/CD process. - Updated test assertions to use TxStatus for better clarity and maintainability.
1 parent 51fbee9 commit b578caa

File tree

2 files changed

+111
-3
lines changed

2 files changed

+111
-3
lines changed
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Recursive Verification Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
paths:
11+
- 'recursive_verification/**'
12+
- '.github/workflows/recursive-verification-tests.yml'
13+
workflow_dispatch:
14+
15+
jobs:
16+
recursive-verification-tests:
17+
name: Recursive Verification Tests
18+
runs-on: ubuntu-latest
19+
env:
20+
AZTEC_ENV: sandbox
21+
AZTEC_VERSION: 2.0.3
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v5
26+
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: "22"
31+
32+
- name: Setup Bun
33+
uses: oven-sh/setup-bun@v2
34+
with:
35+
bun-version: latest
36+
37+
- name: Set up Docker
38+
uses: docker/setup-buildx-action@v3
39+
40+
- name: Install Aztec CLI
41+
run: |
42+
curl -s https://install.aztec.network > tmp.sh
43+
NON_INTERACTIVE=1 bash tmp.sh
44+
rm tmp.sh
45+
46+
- name: Update path
47+
run: echo "$HOME/.aztec/bin" >> $GITHUB_PATH
48+
49+
- name: Set Aztec version and start sandbox
50+
run: |
51+
aztec-up ${{ env.AZTEC_VERSION }}
52+
aztec start --sandbox &
53+
54+
- name: Wait for sandbox to be ready
55+
run: |
56+
echo "Waiting for sandbox to start..."
57+
MAX_RETRIES=60
58+
for i in $(seq 1 $MAX_RETRIES); do
59+
if curl -s http://localhost:8080/status >/dev/null 2>&1; then
60+
echo "✅ Sandbox is ready!"
61+
break
62+
fi
63+
if [ $i -eq $MAX_RETRIES ]; then
64+
echo "❌ Sandbox failed to start after $MAX_RETRIES attempts"
65+
exit 1
66+
fi
67+
echo "Waiting... ($i/$MAX_RETRIES)"
68+
sleep 2
69+
done
70+
71+
- name: Install project dependencies
72+
working-directory: recursive_verification
73+
run: bun install
74+
75+
- name: Compile Noir circuit
76+
working-directory: recursive_verification/circuit
77+
run: aztec-nargo compile
78+
79+
- name: Compile contract and generate artifacts
80+
working-directory: recursive_verification
81+
run: bun ccc
82+
83+
- name: Generate proof data
84+
working-directory: recursive_verification
85+
run: bun data
86+
87+
- name: Run tests
88+
working-directory: recursive_verification
89+
run: bun test
90+
timeout-minutes: 10
91+
92+
- name: Upload test results if failed
93+
if: failure()
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: test-logs
97+
path: |
98+
recursive_verification/tests/**/*.log
99+
recursive_verification/data.json
100+
retention-days: 7
101+
102+
- name: Cleanup
103+
if: always()
104+
run: |
105+
echo "Stopping Aztec sandbox..."
106+
pkill -f "aztec" || true
107+
docker stop $(docker ps -q) || true
108+
docker rm $(docker ps -a -q) || true

recursive_verification/tests/recursive_verification.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, test, beforeAll } from "bun:test"
2-
import { AccountWalletWithSecretKey, Contract, createPXEClient, waitForPXE, type FieldLike, type PXE } from "@aztec/aztec.js"
2+
import { AccountWalletWithSecretKey, Contract, createPXEClient, waitForPXE, type FieldLike, type PXE, TxStatus } from "@aztec/aztec.js"
33
import { getInitialTestAccountsWallets } from '@aztec/accounts/testing'
44
import { ValueNotEqualContract, ValueNotEqualContractArtifact } from '../contract/artifacts/ValueNotEqual'
55
import data from '../data.json'
@@ -62,7 +62,7 @@ describe("Recursive Verification", () => {
6262

6363
expect(tx).toBeDefined()
6464
expect(tx.txHash).toBeDefined()
65-
expect(tx.status).toBe("success")
65+
expect(tx.status).toBe(TxStatus.SUCCESS)
6666

6767
console.log(`Transaction hash: ${tx.txHash.toString()}`)
6868
console.log(`Transaction status: ${tx.status}`)
@@ -90,7 +90,7 @@ describe("Recursive Verification", () => {
9090

9191
expect(tx).toBeDefined()
9292
expect(tx.txHash).toBeDefined()
93-
expect(tx.status).toBe("success")
93+
expect(tx.status).toBe(TxStatus.SUCCESS)
9494

9595
// Check counter value is now 12
9696
const counterValue = await valueNotEqualContract.methods.get_counter(

0 commit comments

Comments
 (0)