|
17 | 17 | deploy-preview: |
18 | 18 | name: Push Preview to Netlify |
19 | 19 | runs-on: ubuntu-latest |
| 20 | + outputs: |
| 21 | + PREVIEW_URL: ${{ steps.deploy.outputs.PREVIEW_URL }} |
20 | 22 | permissions: |
21 | 23 | deployments: write # deployments |
22 | 24 | statuses: write # commit statuses |
|
63 | 65 | run: npm install -g netlify-cli |
64 | 66 |
|
65 | 67 | - name: Deploy to Netlify |
| 68 | + id: deploy |
66 | 69 | if: env.PR_NUMBER != '' |
67 | 70 | env: |
68 | 71 | NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
|
85 | 88 | echo "DEPLOY_URL=$DEPLOY_URL" |
86 | 89 | echo "DEPLOY_ID=$DEPLOY_ID" |
87 | 90 | } >>"$GITHUB_ENV" |
| 91 | + echo "PREVIEW_URL=$PREVIEW_URL" >> "$GITHUB_OUTPUT" |
88 | 92 |
|
89 | 93 | - name: Post PR Comment |
90 | 94 | if: env.PR_NUMBER != '' |
@@ -222,3 +226,31 @@ jobs: |
222 | 226 | -f state="success" \ |
223 | 227 | -f environment_url="${{ env.DEPLOY_URL }}" \ |
224 | 228 | -f description="Preview is ready!" |
| 229 | +
|
| 230 | + e2e-staging: |
| 231 | + name: UI tests on Staging deployment (${{ matrix.project }}) |
| 232 | + runs-on: ${{ matrix.os }} |
| 233 | + needs: deploy-preview |
| 234 | + if: needs.deploy-preview.result == 'success' |
| 235 | + strategy: |
| 236 | + fail-fast: false |
| 237 | + matrix: |
| 238 | + project: [chromium, firefox, mobile] |
| 239 | + os: [ubuntu-latest] |
| 240 | + steps: |
| 241 | + - name: Check out repository |
| 242 | + uses: actions/checkout@v6 |
| 243 | + with: |
| 244 | + ref: ${{ github.event.workflow_run.head_sha }} |
| 245 | + |
| 246 | + - name: Install Nix |
| 247 | + uses: cachix/install-nix-action@19effe9fe722874e6d46dd7182e4b8b7a43c4a99 # v31.10.0 |
| 248 | + |
| 249 | + - uses: cachix/cachix-action@v16 |
| 250 | + with: |
| 251 | + name: ngi-forge |
| 252 | + |
| 253 | + - name: Run Playwright tests |
| 254 | + run: nix develop -c playwright test -c ui/tests/e2e --project=${{ matrix.project }} |
| 255 | + env: |
| 256 | + BASE_URL: ${{ needs.deploy-preview.outputs.PREVIEW_URL }} |
0 commit comments