forked from dubinc/dub
-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (138 loc) · 4.44 KB
/
playwright.yaml
File metadata and controls
167 lines (138 loc) · 4.44 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Playwright E2E Tests
on:
pull_request:
branches: [main]
paths:
- "apps/web/**"
- "packages/**"
- ".github/workflows/playwright.yaml"
concurrency:
group: e2e-${{ github.head_ref }}
cancel-in-progress: true
jobs:
e2e:
permissions:
contents: read
timeout-minutes: 20
runs-on: ubuntu-latest
env:
CI: "true"
NODE_OPTIONS: "--max-old-space-size=8192"
DATABASE_URL: "mysql://root:@localhost:3306/planetscale"
PLANETSCALE_DATABASE_URL: "http://root:unused@localhost:3900/planetscale"
NEXTAUTH_SECRET: "e2e-test-secret-at-least-32-chars-long"
NEXTAUTH_URL: "http://partners.localhost:8888"
NEXT_PUBLIC_APP_NAME: "Dub"
NEXT_PUBLIC_APP_DOMAIN: "localhost:8888"
NEXT_PUBLIC_APP_SHORT_DOMAIN: "dub.sh"
E2E_PARTNER_EMAIL: "partner1@dub-internal-test.com"
E2E_PARTNER_PASSWORD: "password"
TINYBIRD_API_KEY: "xx"
TINYBIRD_API_URL: "xx"
AXIOM_TOKEN: "xx"
AXIOM_DATASET: "xx"
# serverless-redis-http (SRH) — must match jobs.e2e.services.srh env
SRH_TOKEN: "e2e_srh_token"
UPSTASH_REDIS_REST_URL: "http://127.0.0.1:8079"
UPSTASH_REDIS_REST_TOKEN: "e2e_srh_token"
UPSTASH_VECTOR_REST_URL: "https://sensible-camel-xxxx.upstash.io"
UPSTASH_VECTOR_REST_TOKEN: "xx"
QSTASH_TOKEN: "xx"
QSTASH_CURRENT_SIGNING_KEY: "xx"
QSTASH_NEXT_SIGNING_KEY: "xx"
# RESEND_API_KEY must be unset so emails route through SMTP to MailHog
SMTP_HOST: "localhost"
SMTP_PORT: "1025"
SMTP_USER: "smtpUser"
SMTP_PASSWORD: "smtpPassword"
EMBEDDING_SYNC_SECRET: "xx"
ANTHROPIC_API_KEY: "xx"
STRIPE_SECRET_KEY: "xx"
STRIPE_WEBHOOK_SECRET: "xx"
STRIPE_CONNECT_WEBHOOK_SECRET: "xx"
STRIPE_APP_WEBHOOK_SECRET_TEST: "xx"
STRIPE_APP_SECRET_KEY_TEST: "xx"
STRIPE_CONNECT_V2_WEBHOOK_SECRET: "xx"
STRIPE_APP_SECRET_KEY_SANDBOX: "xx"
STRIPE_APP_SECRET_KEY: "xx"
services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: planetscale
MYSQL_ROOT_HOST: "%"
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1"
--health-interval=10s
--health-timeout=5s
--health-retries=5
ports:
- 3306:3306
mailhog:
image: mailhog/mailhog:latest
ports:
- 1025:1025
- 8025:8025
redis:
image: redis:7-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
srh:
image: hiett/serverless-redis-http:latest
env:
SRH_MODE: env
SRH_TOKEN: "e2e_srh_token"
SRH_CONNECTION_STRING: redis://redis:6379
ports:
- 8079:80
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Start PlanetScale simulator
run: |
docker run -d --name ps-http-sim \
--network host \
ghcr.io/mattrobenolt/ps-http-sim:latest \
-listen-addr=0.0.0.0 \
-listen-port=3900 \
-mysql-dbname=planetscale \
-mysql-no-pass \
-mysql-addr=127.0.0.1
- name: Setup pnpm
uses: pnpm/action-setup@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('apps/web/package.json') }}
- name: Install Playwright Chromium
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm --filter web exec playwright install chromium
- name: Generate Prisma client
working-directory: apps/web
run: pnpm prisma:generate
- name: Push database schema
working-directory: apps/web
run: pnpm prisma:push
- name: Seed test data
working-directory: apps/web
run: pnpm tsx playwright/seed.ts
- name: Build application
run: pnpm turbo build --filter=web
- name: Run Playwright tests
working-directory: apps/web
run: pnpm test:e2e