-
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (75 loc) · 2.14 KB
/
Copy pathci.yml
File metadata and controls
92 lines (75 loc) · 2.14 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
name: CI
on:
push:
branches: ["main", "develop"]
pull_request:
branches: ["main", "develop"]
workflow_dispatch:
# Cancel an in-progress CI run when a new push hits the same branch/PR
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
NODE_VERSION: "22"
jobs:
build-and-test:
name: Lint, Typecheck, Build & Test
runs-on: ubuntu-latest
timeout-minutes: 20
# Service containers for DB-dependent tests (Prisma / integration)
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: msk
POSTGRES_PASSWORD: msk
POSTGRES_DB: msk_forms_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U msk"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: "postgresql://msk:msk@localhost:5432/msk_forms_test?schema=public"
REDIS_URL: "redis://localhost:6379"
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup pnpm
# Version is read from the "packageManager" field in package.json.
# (action-setup@v6 also forbids passing the "version" input.)
uses: pnpm/action-setup@v6
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Prisma generate & validate
run: |
pnpm prisma generate
pnpm prisma validate
- name: Apply migrations to test DB
run: pnpm prisma migrate deploy
- name: Lint
run: pnpm run lint
- name: Typecheck
run: pnpm run typecheck
- name: Unit & Integration Tests
run: pnpm run test
- name: Build
run: pnpm run build