Skip to content

Commit 30468a1

Browse files
Merge branch 'main' into feature/e2e-after-vercel-deployment
2 parents 570a79b + 221be87 commit 30468a1

File tree

5 files changed

+587
-17
lines changed

5 files changed

+587
-17
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Playwright Tests
2+
3+
on:
4+
deployment_status:
5+
6+
permissions:
7+
contents: read
8+
issues: write # ✅ Required for issue comments
9+
10+
jobs:
11+
run-e2es:
12+
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'Preview'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Print environment
16+
run: echo ${{ github.event.deployment_status.environment }}
17+
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Install dependencies
22+
run: npm ci && npx playwright install --with-deps
23+
24+
- name: Run Playwright tests
25+
env:
26+
BASE_URL: ${{ github.event.deployment_status.environment_url }}
27+
run: npx playwright test
28+
29+
- name: Upload Playwright Report
30+
uses: actions/upload-artifact@v4
31+
if: always()
32+
with:
33+
name: playwright-report
34+
path: playwright-report/
35+
retention-days: 7
36+
37+
- name: GitHub Notification
38+
if: failure()
39+
uses: actions/github-script@v6
40+
with:
41+
github-token: ${{ secrets.GITHUB_TOKEN }} # ✅ Fix GitHub API auth
42+
script: |
43+
github.rest.issues.createComment({
44+
owner: context.repo.owner,
45+
repo: context.repo.repo,
46+
issue_number: 1,
47+
body: "🚨 Playwright tests failed after deployment!"
48+
});

0 commit comments

Comments
 (0)