-
Notifications
You must be signed in to change notification settings - Fork 140
120 lines (102 loc) Β· 3.21 KB
/
e2e-tests.yml
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
name: π§ͺ E2E Tests
on:
push:
branches:
- master
- main
- develop
- staging
pull_request:
branches:
- master
- main
- develop
- staging
jobs:
E2E:
name: Playwright E2E Tests
timeout-minutes: 30
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_BASE_URL: http://localhost:3000
NEXT_PUBLIC_ENV_NAME: tests
DATABASE_URL: postgres://startui:startui@localhost:5432/startui
NEXT_PUBLIC_IS_DEMO: false
AUTH_SECRET: Replace me with `openssl rand -base64 32` generated secret
EMAIL_SERVER: smtp://username:password@localhost:1025
EMAIL_FROM: Start UI <[email protected]>
S3_ENDPOINT: http://127.0.0.1:9000
S3_BUCKET_NAME: start-ui-bucket
S3_BUCKET_PUBLIC_URL: http://127.0.0.1:9000/start-ui-bucket
S3_ACCESS_KEY_ID: miniotestuser
S3_SECRET_ACCESS_KEY: miniotestuserpassword
services:
postgres:
image: postgres
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
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
# - name: Setup minio
# env:
# MINIO_ACCESS_KEY: minioadmin
# MINIO_SECRET_KEY: minioadmin
# run: |
# docker run -d -p 9000:9000 --name minio
# -e MINIO_ACCESS_KEY=startui \
# -e MINIO_SECRET_KEY=password \
# -v /tmp/data:/data \
# -v /tmp/config:/root/.minio \
# minio/minio server /data
# export S3_ACCESS_KEY_ID=miniotestuser
# export S3_SECRET_ACCESS_KEY=miniotestuserpassword
# export AWS_EC2_METADATA_DISABLED=true
# aws --endpoint-url http://127.0.0.1:9000/start-ui-bucket s3 mb s3://testbucket
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo STORE_PATH=$(pnpm store path --silent) >> $GITHUB_ENV
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
${{ runner.os }}-pnpm-store-
${{ runner.os }}-
- name: Install dependencies
run: pnpm install
- name: Install Playwright Browsers
run: pnpm playwright install --with-deps
- name: Migrate database
run: pnpm db:push
- name: Add default data into database
run: pnpm db:seed
- name: Run Playwright tests
run: pnpm e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30