-
Notifications
You must be signed in to change notification settings - Fork 161
127 lines (110 loc) · 3.59 KB
/
Copy pathe2e-tests.yml
File metadata and controls
127 lines (110 loc) · 3.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
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
name: 🧪 E2E Tests
on:
push:
branches:
- master
- main
- develop
- staging
pull_request:
jobs:
E2E:
name: E2E (${{ matrix.browser }})
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
env:
VITE_BASE_URL: http://localhost:3000
VITE_ENV_NAME: tests
DATABASE_URL: postgres://startui:startui@localhost:5432/startui
VITE_IS_DEMO: false
AUTH_SECRET: fyXjLxjXJowjicI2BAjxOaUsQd1QafdegZDciJE/xM8=
EMAIL_SERVER: smtp://username:password@localhost:1025
EMAIL_FROM: Start UI <noreply@example.com>
S3_HOST: localhost:9000
S3_BUCKET_NAME: default
S3_ACCESS_KEY_ID: startui-access-key
S3_SECRET_ACCESS_KEY: startui-secret-key
S3_SECURE: false
S3_FORCE_PATH_STYLE: true
DOCKER_MINIO_USERNAME: minioadmin
DOCKER_MINIO_PASSWORD: minioadmin
VITE_S3_BUCKET_PUBLIC_URL: http://localhost:9000/default
services:
postgres:
image: postgres:16.1
env:
POSTGRES_PASSWORD: startui
POSTGRES_USER: startui
POSTGRES_DB: startui
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
maildev:
image: maildev/maildev:2.2.1
options: >-
--health-cmd "wget --spider --no-verbose --tries=1 -T 3 http://localhost:1080/healthz"
--health-interval 5s
--health-timeout 5s
--health-retries 5
ports:
- 1025:1025
- 1080:1080
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm
with:
node-version: 22
- name: Setup Playwright
uses: ./.github/actions/setup-playwright
with:
browsers: chromium ${{ matrix.browser }}
- name: Start MinIO server
run: |
docker run -d \
--name minio \
-p 9000:9000 \
-p 9001:9001 \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=minioadmin \
minio/minio:RELEASE.2025-07-23T15-54-02Z-cpuv1 \
server /data --console-address :9001
# Wait for MinIO to be ready
until curl -sf http://localhost:9000/minio/health/live; do
echo "Waiting for MinIO..."
sleep 2
done
echo "MinIO is ready"
- name: Setup MinIO bucket
run: |
# Install MinIO client
curl -sSL https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc
chmod +x /usr/local/bin/mc
# Configure MinIO client
mc alias set minio http://localhost:9000 minioadmin minioadmin
# Create user with access key
mc admin user add minio $S3_ACCESS_KEY_ID $S3_SECRET_ACCESS_KEY
mc admin policy attach minio readwrite --user $S3_ACCESS_KEY_ID
# Create bucket and set permissions
mc mb --ignore-existing minio/$S3_BUCKET_NAME
mc anonymous set download minio/$S3_BUCKET_NAME
- name: Migrate database
run: pnpm db:push
- name: Add default data into database
run: pnpm db:seed
- name: Run Playwright tests
run: pnpm exec playwright test --project=${{ matrix.browser }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.browser }}
path: playwright-report/
retention-days: 30