-
Notifications
You must be signed in to change notification settings - Fork 6
38 lines (36 loc) · 1.23 KB
/
playwright-tests-published.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Playwright Tests Published
on:
deployment_status:
jobs:
run-e2e-published:
name: Run end-to-end tests on published site
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install dependencies
run: npm ci && npx playwright install --with-deps
- name: Run tests on preview PR
if: github.event.deployment_status.environment != 'Production'
run: npx playwright test
env:
PUBLIC_ENV: preview
VERCEL_URL: ${{ github.event.deployment_status.target_url }}
DEBUG: pw:api
- name: Run tests on production PR
if: github.event.deployment_status.environment == 'Production'
run: npx playwright test
env:
PUBLIC_ENV: production
VERCEL_URL: https://sharrr.com
DEBUG: pw:api
- name: Create folder for artifacts
if: always()
run: mkdir -p test-results
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-report-published
path: test-results