-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (48 loc) · 1.48 KB
/
test.yaml
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
name: Test
on:
pull_request:
types: [opened, synchronize]
env:
ADMIN_KEY: foobar
DATABASE_URL: postgres://postgres:postgres@localhost:5432/echo-web
NEXT_PUBLIC_SANITY_DATASET: testing
NEXT_PUBLIC_ARS_URL: http://localhost:4444
FEIDE_CLIENT_ID: ${{ secrets.FEIDE_CLIENT_ID }}
FEIDE_CLIENT_SECRET: ${{ secrets.FEIDE_CLIENT_SECRET }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15.7
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: echo-web
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm-install
- run: pnpm db:migrate
- name: Install playwright browsers
run: pnpm --filter=playwright test:install
- name: Seed database
run: pnpm seed database --mode test
- name: Build
run: pnpm build
- name: Run unit tests
run: pnpm test:unit
- name: Run playwright tests
run: pnpm test:e2e
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright/playwright-report/
retention-days: 30