|
| 1 | +name: Test Wallet Webapp Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + paths: |
| 11 | + - "test-wallet-webapp/**" |
| 12 | + - ".github/workflows/test-wallet-webapp-tests.yml" |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +jobs: |
| 16 | + test-wallet-webapp-tests: |
| 17 | + name: Test Wallet Webapp Tests |
| 18 | + runs-on: ubuntu-latest |
| 19 | + env: |
| 20 | + AZTEC_VERSION: 3.0.0-devnet.5 |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout repository |
| 24 | + uses: actions/checkout@v5 |
| 25 | + |
| 26 | + - name: Set up Node.js |
| 27 | + uses: actions/setup-node@v4 |
| 28 | + with: |
| 29 | + node-version: "22" |
| 30 | + |
| 31 | + - name: Enable Corepack |
| 32 | + run: corepack enable |
| 33 | + |
| 34 | + - name: Set up Docker |
| 35 | + uses: docker/setup-buildx-action@v3 |
| 36 | + |
| 37 | + - name: Install Aztec CLI |
| 38 | + run: | |
| 39 | + curl -s https://install.aztec.network > tmp.sh |
| 40 | + NON_INTERACTIVE=1 bash tmp.sh |
| 41 | + rm tmp.sh |
| 42 | +
|
| 43 | + - name: Update path |
| 44 | + run: echo "$HOME/.aztec/bin" >> $GITHUB_PATH |
| 45 | + |
| 46 | + - name: Set Aztec version and start sandbox |
| 47 | + run: | |
| 48 | + aztec-up ${{ env.AZTEC_VERSION }} |
| 49 | + docker tag aztecprotocol/aztec:${{ env.AZTEC_VERSION }} aztecprotocol/aztec:latest |
| 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: test-wallet-webapp |
| 71 | + run: yarn install --frozen-lockfile |
| 72 | + |
| 73 | + - name: Run lint |
| 74 | + working-directory: test-wallet-webapp |
| 75 | + run: yarn lint |
| 76 | + |
| 77 | + - name: Build project |
| 78 | + working-directory: test-wallet-webapp |
| 79 | + run: yarn build |
| 80 | + |
| 81 | + - name: Upload build artifacts if failed |
| 82 | + if: failure() |
| 83 | + uses: actions/upload-artifact@v4 |
| 84 | + with: |
| 85 | + name: build-artifacts |
| 86 | + path: | |
| 87 | + test-wallet-webapp/dist/ |
| 88 | + test-wallet-webapp/node_modules/.vite/ |
| 89 | + retention-days: 7 |
| 90 | + |
| 91 | + - name: Cleanup |
| 92 | + if: always() |
| 93 | + run: | |
| 94 | + echo "Stopping Aztec sandbox..." |
| 95 | + pkill -f "aztec" || true |
| 96 | + docker stop $(docker ps -q) || true |
| 97 | + docker rm $(docker ps -a -q) || true |
0 commit comments