|
| 1 | +name: Note Send Proof Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + paths: |
| 11 | + - "note-send-proof/**" |
| 12 | + - ".github/workflows/note-send-proof-tests.yml" |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +jobs: |
| 16 | + note-send-proof-tests: |
| 17 | + name: Note Send Proof 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: Enable Corepack for Yarn |
| 33 | + run: corepack enable |
| 34 | + |
| 35 | + - name: Set up Docker |
| 36 | + uses: docker/setup-buildx-action@v3 |
| 37 | + |
| 38 | + - name: Install Aztec CLI |
| 39 | + run: | |
| 40 | + curl -s https://install.aztec.network > tmp.sh |
| 41 | + NON_INTERACTIVE=1 bash tmp.sh |
| 42 | + rm tmp.sh |
| 43 | +
|
| 44 | + - name: Update path |
| 45 | + run: echo "$HOME/.aztec/bin" >> $GITHUB_PATH |
| 46 | + |
| 47 | + - name: Set Aztec version and start sandbox |
| 48 | + run: | |
| 49 | + aztec-up ${{ env.AZTEC_VERSION }} |
| 50 | + aztec start --sandbox & |
| 51 | +
|
| 52 | + - name: Wait for sandbox to be ready |
| 53 | + run: | |
| 54 | + echo "Waiting for sandbox to start..." |
| 55 | + MAX_RETRIES=60 |
| 56 | + for i in $(seq 1 $MAX_RETRIES); do |
| 57 | + if curl -s http://localhost:8080/status >/dev/null 2>&1; then |
| 58 | + echo "✅ Sandbox is ready!" |
| 59 | + break |
| 60 | + fi |
| 61 | + if [ $i -eq $MAX_RETRIES ]; then |
| 62 | + echo "❌ Sandbox failed to start after $MAX_RETRIES attempts" |
| 63 | + exit 1 |
| 64 | + fi |
| 65 | + echo "Waiting... ($i/$MAX_RETRIES)" |
| 66 | + sleep 2 |
| 67 | + done |
| 68 | +
|
| 69 | + - name: Install project dependencies |
| 70 | + working-directory: note-send-proof |
| 71 | + run: yarn install |
| 72 | + |
| 73 | + - name: Compile Aztec contract |
| 74 | + working-directory: note-send-proof/sample-contract |
| 75 | + run: aztec-nargo compile |
| 76 | + |
| 77 | + - name: Post-process contract and generate artifacts |
| 78 | + working-directory: note-send-proof |
| 79 | + run: yarn ccc |
| 80 | + |
| 81 | + - name: Generate note hash data |
| 82 | + working-directory: note-send-proof |
| 83 | + env: |
| 84 | + NODE_OPTIONS: "--max-old-space-size=6144" |
| 85 | + run: | |
| 86 | + echo "Generating note hash data..." |
| 87 | + yarn data |
| 88 | + timeout-minutes: 15 |
| 89 | + |
| 90 | + - name: Run tests |
| 91 | + working-directory: note-send-proof |
| 92 | + run: yarn test |
| 93 | + timeout-minutes: 15 |
| 94 | + |
| 95 | + - name: Upload test results if failed |
| 96 | + if: failure() |
| 97 | + uses: actions/upload-artifact@v4 |
| 98 | + with: |
| 99 | + name: test-logs |
| 100 | + path: | |
| 101 | + note-send-proof/tests/**/*.log |
| 102 | + note-send-proof/data.json |
| 103 | + retention-days: 7 |
| 104 | + |
| 105 | + - name: Cleanup |
| 106 | + if: always() |
| 107 | + run: | |
| 108 | + echo "Stopping Aztec sandbox..." |
| 109 | + pkill -f "aztec" || true |
| 110 | + docker stop $(docker ps -q) || true |
| 111 | + docker rm $(docker ps -a -q) || true |
0 commit comments