|
| 1 | +name: ZKEmail Testnet Verification |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - next |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - next |
| 10 | + paths: |
| 11 | + - "zkemail_verification/**" |
| 12 | + - ".github/workflows/zkemail-testnet.yml" |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +jobs: |
| 16 | + zkemail-testnet: |
| 17 | + name: ZKEmail Proof Verification on Testnet |
| 18 | + runs-on: ubuntu-latest |
| 19 | + env: |
| 20 | + AZTEC_VERSION: 4.2.0-aztecnr-rc.2 |
| 21 | + TESTNET_URL: https://rpc.testnet.aztec-labs.com |
| 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 | + cache: "yarn" |
| 32 | + cache-dependency-path: zkemail_verification/yarn.lock |
| 33 | + |
| 34 | + - name: Install Foundry |
| 35 | + uses: foundry-rs/foundry-toolchain@v1 |
| 36 | + |
| 37 | + - name: Install Aztec CLI |
| 38 | + run: | |
| 39 | + INSTALL_URL="https://install.aztec.network/${{ env.AZTEC_VERSION }}/" |
| 40 | + curl -sL $INSTALL_URL > tmp.sh |
| 41 | + VERSION=${{ env.AZTEC_VERSION }} bash tmp.sh <<< yes "yes" |
| 42 | +
|
| 43 | + - name: Update path |
| 44 | + run: | |
| 45 | + echo "$HOME/.aztec/current/bin" >> $GITHUB_PATH |
| 46 | + echo "$HOME/.aztec/current/node_modules/.bin" >> $GITHUB_PATH |
| 47 | + echo "$HOME/.aztec/bin" >> $GITHUB_PATH |
| 48 | +
|
| 49 | + - name: Install project dependencies |
| 50 | + working-directory: zkemail_verification |
| 51 | + run: yarn install --frozen-lockfile |
| 52 | + |
| 53 | + - name: Compile Noir circuit |
| 54 | + working-directory: zkemail_verification/circuit |
| 55 | + run: nargo compile |
| 56 | + timeout-minutes: 10 |
| 57 | + |
| 58 | + - name: Change ownership for nargo files |
| 59 | + run: sudo chown -R $(whoami) ~/nargo || true |
| 60 | + |
| 61 | + - name: Compile contract and generate artifacts |
| 62 | + working-directory: zkemail_verification |
| 63 | + run: | |
| 64 | + ulimit -s unlimited |
| 65 | + script -e -c "yarn ccc" |
| 66 | + timeout-minutes: 15 |
| 67 | + |
| 68 | + - name: Generate proof data |
| 69 | + working-directory: zkemail_verification |
| 70 | + env: |
| 71 | + BB_SINGLE_THREADED: "1" |
| 72 | + HARDWARE_CONCURRENCY: "1" |
| 73 | + NODE_OPTIONS: "--max-old-space-size=6144" |
| 74 | + run: yarn data |
| 75 | + timeout-minutes: 30 |
| 76 | + |
| 77 | + - name: Check testnet is reachable |
| 78 | + run: | |
| 79 | + echo "Checking testnet status..." |
| 80 | + curl -sf ${{ env.TESTNET_URL }}/status || (echo "Testnet unreachable" && exit 1) |
| 81 | + echo "Testnet is reachable" |
| 82 | +
|
| 83 | + - name: Deploy and verify on testnet |
| 84 | + working-directory: zkemail_verification |
| 85 | + run: yarn testnet |
| 86 | + timeout-minutes: 20 |
| 87 | + |
| 88 | + - name: Upload proof data on failure |
| 89 | + if: failure() |
| 90 | + uses: actions/upload-artifact@v4 |
| 91 | + with: |
| 92 | + name: zkemail-testnet-logs |
| 93 | + path: | |
| 94 | + zkemail_verification/data.json |
| 95 | + retention-days: 7 |
0 commit comments