feat(APP-543): Add build verification workflow and enhance e2e tests #3960
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The "App Preview" workflow runs on every pull request. It deploys a preview environment to Vercel, comments the | |
| # deployment URL on the pull request, and runs E2E smoke tests plus build verification (Synpress) against the preview. | |
| name: App Preview | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| deploy: | |
| if: ${{ !startsWith(github.head_ref, 'release/') && !startsWith(github.head_ref, 'hotfix/') }} | |
| uses: ./.github/workflows/shared-deploy.yml | |
| secrets: inherit | |
| with: | |
| env: "preview" | |
| comment: | |
| runs-on: ubuntu-latest | |
| needs: deploy | |
| steps: | |
| - name: Comment preview PR | |
| uses: thollander/actions-comment-pull-request@v3.0.1 | |
| with: | |
| message: "🚀 **Preview Deployment:** [View Here](${{ needs.deploy.outputs.deploymentUrl }})" | |
| comment-tag: preview-url | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| e2e: | |
| needs: deploy | |
| uses: ./.github/workflows/shared-e2e.yml | |
| secrets: inherit | |
| with: | |
| deployment-url: ${{ needs.deploy.outputs.deploymentUrl }} | |
| environment: preview | |
| # BV needs MetaMask secrets; fork PRs do not receive repo secrets, so skip to avoid a failing job. | |
| bv: | |
| if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
| needs: deploy | |
| uses: ./.github/workflows/shared-bv.yml | |
| secrets: inherit | |
| with: | |
| deployment-url: ${{ needs.deploy.outputs.deploymentUrl }} | |
| environment: preview | |
| e2e-comment: | |
| needs: [deploy, e2e, bv] | |
| if: ${{ always() && needs.deploy.result == 'success' && needs.e2e.result != 'skipped' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Comment E2E results | |
| uses: thollander/actions-comment-pull-request@v3.0.1 | |
| with: | |
| comment-tag: e2e-results | |
| message: | | |
| **E2E results (preview)** | |
| **Smoke** | |
| | | | | |
| |---|---| | |
| | Base URL | ${{ needs.deploy.outputs.deploymentUrl }} | | |
| | Suite | smoke | | |
| | Playwright result | ${{ needs.e2e.outputs.result_label }} | | |
| | Summary | ${{ needs.e2e.outputs.summary }} | | |
| | GitHub job | ${{ needs.e2e.result == 'success' && '✅ completed' || needs.e2e.result == 'failure' && '❌ workflow failed' || '⏹️ cancelled' }} | | |
| **Build verification (Synpress)** | |
| | | | | |
| |---|---| | |
| | Suite | bv | | |
| | Playwright result | ${{ needs.bv.result == 'skipped' && '⏭️ skipped (fork PR — no repo secrets)' || needs.bv.outputs.result_label }} | | |
| | Summary | ${{ needs.bv.result == 'skipped' && '—' || needs.bv.outputs.summary }} | | |
| | GitHub job | ${{ needs.bv.result == 'skipped' && '⏭️ skipped' || needs.bv.result == 'success' && '✅ completed' || needs.bv.result == 'failure' && '❌ workflow failed' || '⏹️ cancelled' }} | | |
| [View run #${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
| github-token: ${{ secrets.GITHUB_TOKEN }} |