-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (67 loc) Β· 2.09 KB
/
ci.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
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
name: CI
on:
pull_request:
types: [opened, synchronize]
env:
ADMIN_KEY: foobar
DATABASE_URL: postgres://postgres:postgres@localhost:5432/echo-web
API_PORT: 8000
NEXT_PUBLIC_API_URL: http://localhost:8000
NEXT_PUBLIC_SANITY_DATASET: "testing"
FEIDE_CLIENT_ID: ${{ secrets.FEIDE_CLIENT_ID }}
FEIDE_CLIENT_SECRET: ${{ secrets.FEIDE_CLIENT_SECRET }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXTAUTH_URL: http://localhost:3000
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
ci:
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:
- name: π Checkout
uses: actions/checkout@v4
- name: π¦ Setup pnpm
uses: pnpm/action-setup@v4
- name: π’ Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: ./pnpm-lock.yaml
- name: π¦ Install dependencies
run: pnpm install --frozen-lockfile
- name: ποΈ Migrate database
run: pnpm db:migrate
- name: π Lint
run: pnpm lint
- name: π« Type check
run: pnpm typecheck
- name: π Check style
run: pnpm format:check
- name: π± Seed database
run: pnpm seed database --mode test
- name: π·π»ββοΈ Build
run: pnpm build
- name: π§ͺ Run unit tests
run: pnpm test:unit
- name: π» Install playwright browsers
run: pnpm --filter=playwright test:install
- 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