|
| 1 | +name: E2E Verification Tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [main, develop] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +# Read-only document verification suite (OA + W3C VC). No MetaMask, runs headless. |
| 9 | +jobs: |
| 10 | + e2e-verify: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + timeout-minutes: 30 |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Setup Node.js |
| 19 | + uses: actions/setup-node@v4 |
| 20 | + with: |
| 21 | + node-version: '20' |
| 22 | + cache: 'npm' |
| 23 | + |
| 24 | + - name: Install dependencies |
| 25 | + run: npm ci |
| 26 | + |
| 27 | + - name: Install Playwright browsers |
| 28 | + run: npx playwright install chromium --with-deps |
| 29 | + |
| 30 | + # ── Local chain + contracts ────────────────────────────────────────── |
| 31 | + - name: Start Hardhat node |
| 32 | + run: npx hardhat node & |
| 33 | + env: |
| 34 | + NODE_OPTIONS: --max-old-space-size=4096 |
| 35 | + |
| 36 | + - name: Wait for Hardhat node |
| 37 | + run: npx wait-on http://127.0.0.1:8545 --timeout 180000 |
| 38 | + |
| 39 | + # Token registry (token-registry fixtures) + document store (doc-store fixtures) |
| 40 | + - name: Deploy contracts and mint tokens |
| 41 | + run: node e2e/setup-contracts.cjs |
| 42 | + |
| 43 | + - name: Deploy document store |
| 44 | + run: node e2e/setup-document-store.cjs |
| 45 | + |
| 46 | + # ── Dev server ─────────────────────────────────────────────────────── |
| 47 | + - name: Start dev server |
| 48 | + run: npm run dev & |
| 49 | + env: |
| 50 | + VITE_APP_NETWORK: local |
| 51 | + VITE_NETWORK_TYPE: testnet |
| 52 | + VITE_RPC_URL_1337: http://127.0.0.1:8545 |
| 53 | + |
| 54 | + - name: Wait for dev server |
| 55 | + run: npx wait-on http://localhost:5173 --timeout 180000 |
| 56 | + |
| 57 | + # ── Verification tests (headless, no MetaMask) ─────────────────────── |
| 58 | + - name: Run verification E2E tests |
| 59 | + run: npm run e2e:verify |
| 60 | + env: |
| 61 | + CI: 'true' |
| 62 | + |
| 63 | + - name: Upload Playwright report |
| 64 | + if: always() |
| 65 | + uses: actions/upload-artifact@v4 |
| 66 | + with: |
| 67 | + name: playwright-report-verify |
| 68 | + path: playwright-report-verify/ |
| 69 | + retention-days: 7 |
| 70 | + |
| 71 | + - name: Upload screenshots on failure |
| 72 | + if: failure() |
| 73 | + uses: actions/upload-artifact@v4 |
| 74 | + with: |
| 75 | + name: verify-test-results |
| 76 | + path: test-results/ |
| 77 | + retention-days: 7 |
| 78 | + if-no-files-found: ignore |
0 commit comments