-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (72 loc) · 2.38 KB
/
e2e.yml
File metadata and controls
87 lines (72 loc) · 2.38 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
name: E2E
on:
push:
branches: [main]
pull_request:
jobs:
playwright:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: stayops
POSTGRES_PASSWORD: stayops
POSTGRES_DB: stayops
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U stayops -d stayops"
--health-interval 5s
--health-timeout 5s
--health-retries 8
--health-start-period 10s
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 8
env:
DATABASE_URL: postgresql://stayops:stayops@localhost:5432/stayops
REDIS_URL: redis://localhost:6379
SESSION_SECRET: ci-e2e-session-secret-at-least-32-chars-long
APP_TIMEZONE: Etc/UTC
BOOTSTRAP_ADMIN_EMAIL: e2e-admin@stayops.local
BOOTSTRAP_ADMIN_PASSWORD: E2E_Test_Password_12+
E2E_ADMIN_EMAIL: e2e-admin@stayops.local
E2E_ADMIN_PASSWORD: E2E_Test_Password_12+
CI: true
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build workspace packages
run: pnpm --filter @stay-ops/shared build && pnpm --filter @stay-ops/db build && pnpm --filter @stay-ops/audit build && pnpm --filter @stay-ops/sync build
- name: Migrate database
run: pnpm --filter @stay-ops/db exec prisma migrate deploy
- name: Seed admin + E2E fixtures
run: pnpm --filter @stay-ops/db seed && pnpm --filter @stay-ops/db seed:e2e
- name: Install Playwright Chromium
run: pnpm --filter @stay-ops/web exec playwright install chromium --with-deps
- name: Run Playwright
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
pnpm --filter @stay-ops/web test:e2e -- --grep "@smoke"
else
pnpm --filter @stay-ops/web test:e2e
fi
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-output
path: |
apps/web/test-results/
apps/web/playwright-report/