-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 1.93 KB
/
test-e2e.yml
File metadata and controls
68 lines (56 loc) · 1.93 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: E2E Tests (playwright)
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
# Triggers: PR opened, updated (new commits), or reopened
# 1. Runs on remote GitHub Actions server (fresh environment, not local cache)
# 2. Required to pass before PR can be merged to main (enforced by branch protection)
#
# Note: This workflow tests against localhost (built from source).
# For E2E tests against Vercel preview deployments, see: test-e2e-vercel.yml
pull_request:
branches: [main]
jobs:
e2e:
name: Run E2E Tests
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
# Step: Checkout code
- uses: actions/checkout@v6
# Step: Setup Node.js
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'npm'
# Step: Install dependencies
- name: Install dependencies
run: npm ci
# Step: Install Playwright Browsers
- name: Install Playwright Browsers
run: npx playwright install chromium webkit --with-deps
# Step: Build production
- name: Build Next.js production
run: npx next build
env:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.CLERK_PUBLISHABLE_KEY }}
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
# Step: Run E2E tests
- name: Run Playwright tests
run: npx playwright test
env:
CLERK_PUBLISHABLE_KEY: ${{ secrets.CLERK_PUBLISHABLE_KEY }}
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
E2E_TEST_EMAIL: ${{ secrets.E2E_TEST_EMAIL }}
E2E_TEST_PASSWORD: ${{ secrets.E2E_TEST_PASSWORD }}
E2E_TEST_OTP: ${{ secrets.E2E_TEST_OTP }}
# Step: Upload test report
- uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: playwright-report
path: .playwright/playwright-report/
retention-days: 30