-
Notifications
You must be signed in to change notification settings - Fork 140
69 lines (65 loc) · 2.1 KB
/
run-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
name: Run tests
on:
pull_request:
types: [opened, synchronize]
workflow_dispatch:
jobs:
run-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test_db
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
- name: Setup application
run: npm ci
- name: Install Chromium for Playwright
run: npx playwright install --with-deps chromium
- name: Start backend and frontend
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_db
JWT_SECRET: ${{ secrets.JWT_SECRET }}
APP_URL: http://0.0.0.0:8080
API_URL: http://0.0.0.0:3333
LUNARY_PUBLIC_KEY: 259d2d94-9446-478a-ae04-484de705b522
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NEXT_PUBLIC_API_URL: http://0.0.0.0:3333
timeout-minutes: 3
run: |
npm run migrate:db
npm run start:backend &
npm run build:frontend
npm run start:frontend &
npx wait-on http://localhost:3333/v1/health http://0.0.0.0:8080/
- name: Run tests
run: npm run test
env:
BASE_URL: http://0.0.0.0:8080
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_db
JWT_SECRET: ${{ secrets.JWT_SECRET }}
APP_URL: http://0.0.0.0:8080
API_URL: http://0.0.0.0:3333
LUNARY_PUBLIC_KEY: 259d2d94-9446-478a-ae04-484de705b522
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NEXT_PUBLIC_API_URL: http://0.0.0.0:3333
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: packages/e2e/playwright-report/
retention-days: 30