Skip to content

Commit 4925e84

Browse files
new workflow to run e2e after deployment
1 parent 08f79ea commit 4925e84

File tree

2 files changed

+40
-125
lines changed

2 files changed

+40
-125
lines changed

.github/workflows/e2e.yml

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

.github/workflows/main.yml

Lines changed: 0 additions & 125 deletions
This file was deleted.

0 commit comments

Comments
 (0)