Repository navigation
102 lines (83 loc) · 2.5 KB
/
Copy pathci.yml
File metadata and controls
102 lines (83 loc) · 2.5 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
name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CI: true
NODE_VERSION: "22"
PNPM_VERSION: "10"
DATABASE_URL: postgres://postgres:postgres@localhost:5432/blank_saas
PAYLOAD_SECRET: ci-payload-secret-must-be-32chars-minimum!!
BETTER_AUTH_SECRET: ci-better-auth-secret-32chars-minimum!!
BETTER_AUTH_URL: http://127.0.0.1:3000
NEXT_PUBLIC_APP_URL: http://127.0.0.1:3000
NEXT_PUBLIC_FEATURE_GRANULAR_PERMISSIONS: "true"
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Typecheck
run: pnpm typecheck
- name: Unit tests
run: pnpm test:unit
- name: Integration tests
run: pnpm test:integration
e2e:
needs: verify
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: blank_saas
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d blank_saas"
--health-interval 4s
--health-timeout 5s
--health-retries 15
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile
- name: Migrate
run: pnpm migrate
env:
DATABASE_URL: ${{ env.DATABASE_URL }}
- name: Install Playwright Chromium
run: pnpm exec playwright install chromium --with-deps
- name: E2E
run: pnpm test:e2e
env:
DATABASE_URL: ${{ env.DATABASE_URL }}
PAYLOAD_SECRET: ${{ env.PAYLOAD_SECRET }}
BETTER_AUTH_SECRET: ${{ env.BETTER_AUTH_SECRET }}
BETTER_AUTH_URL: ${{ env.BETTER_AUTH_URL }}
NEXT_PUBLIC_APP_URL: ${{ env.NEXT_PUBLIC_APP_URL }}
NEXT_PUBLIC_FEATURE_GRANULAR_PERMISSIONS: ${{ env.NEXT_PUBLIC_FEATURE_GRANULAR_PERMISSIONS }}