-
Notifications
You must be signed in to change notification settings - Fork 292
88 lines (77 loc) · 2.59 KB
/
e2e-tests.yml
File metadata and controls
88 lines (77 loc) · 2.59 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: E2E Tests
on:
repository_dispatch:
types:
- 'vercel.deployment.success'
workflow_dispatch:
inputs:
base_url:
description: 'Target URL (e.g. https://xyz.preview.app.daily.dev)'
required: true
type: string
jobs:
e2e-tests:
if: >-
(github.event_name == 'repository_dispatch' && github.event.client_payload.git.ref == 'main') ||
github.event_name == 'workflow_dispatch'
timeout-minutes: 60
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.58.2-noble
options: --user 1001
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24.14'
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.14.4
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Validate base URL
if: github.event_name == 'workflow_dispatch'
shell: bash
run: |
URL="${{ inputs.base_url }}"
if [[ ! "$URL" =~ ^https://([a-zA-Z0-9-]+\.)*app\.daily\.dev(/.*)?$ ]]; then
echo "::error::Invalid URL. Must be an app.daily.dev URL (e.g. https://app.daily.dev or https://xyz.preview.app.daily.dev)"
exit 1
fi
- name: Run Playwright tests
env:
USER_NAME: ${{ secrets.USER_NAME }}
PASSWORD: ${{ secrets.PASSWORD }}
BASE_URL: ${{ inputs.base_url || 'https://app.daily.dev' }}
run: pnpm test:e2e
- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: packages/playwright/playwright-report/
retention-days: 30
- name: Report Status
if: always() && github.run_attempt == 1 && github.event_name != 'workflow_dispatch'
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ job.status }}
notify_when: 'failure'
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>'
footer: 'Linked to Repo <{repo_url}|{repo}>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.E2E_MONITORING_SLACK }}