-
Notifications
You must be signed in to change notification settings - Fork 353
160 lines (150 loc) · 4.58 KB
/
Copy pathci.yml
File metadata and controls
160 lines (150 loc) · 4.58 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: CI
# Runs on pull requests targeting main. Making this a required status check in
# branch protection (see RELEASE.md) is what prevents merging/pushing to main until
# CI is green.
on:
pull_request:
branches: [main]
# Cancel superseded runs on the same ref.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
versions:
name: version sync
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '22'
- name: Check all components match the root VERSION file
run: node scripts/sync-version.mjs --check
cli:
name: CLI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '22'
- run: node --test scripts/kritt.test.mjs scripts/kritt-ui.test.mjs scripts/kritt-headless.test.mjs
docs:
name: docs (links and redirects)
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs-site
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '22'
- run: npm run check-links
frontend:
name: frontend (lint • build • test)
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '22'
- run: npm ci
# Advisory until the one-time lint/format cleanup PR lands, then drop
# continue-on-error to make these hard gates.
- run: npm run lint
continue-on-error: true
- run: npm run format:check
continue-on-error: true
- run: npm run build
- run: npm test
- name: Build the Alpine frontend image
run: docker build --tag open-kritt-frontend-ci .
- name: Verify the Alpine image can load Rollup
run: docker run --rm open-kritt-frontend-ci npm run build
backend:
name: backend (lint • test • prisma validate)
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
env:
DATABASE_URL: postgresql://kritt:kritt@localhost:5432/kritt?schema=public
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '22'
- run: npm ci
# Advisory until the one-time lint/format cleanup PR lands.
- run: npm run lint
continue-on-error: true
- run: npm run format:check
continue-on-error: true
- run: npx prisma validate
- run: npm test
engine:
name: engine (lint • image)
runs-on: ubuntu-latest
defaults:
run:
working-directory: engine
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- run: pip install ruff
# Advisory until the one-time lint/format cleanup PR lands.
- run: ruff check .
continue-on-error: true
- run: ruff format --check .
continue-on-error: true
- name: Build the engine image
run: docker build --tag open-kritt-engine-ci .
# TODO: re-enable the test suite. Several tests currently assume a writable
# /root home (codex/claude dirs) and one has an outdated assertion, so they
# fail on CI runners. Lint-only for now.
# - run: pip install -r requirements.txt
# - run: pytest
database:
name: database (migrations apply idempotently)
runs-on: ubuntu-latest
services:
postgres:
# Match the version the app ships (database/Dockerfile) for prod parity.
image: postgres:16.4-alpine3.20
env:
POSTGRES_USER: kritt
POSTGRES_PASSWORD: kritt
POSTGRES_DB: kritt
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U kritt"
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
DATABASE_URL: postgresql://kritt:kritt@localhost:5432/kritt?schema=public
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '22'
- name: Install backend deps + generate Prisma client
working-directory: backend
run: |
npm ci
npx prisma generate
- name: Apply migrations
working-directory: backend
run: node prisma/migrate.js
- name: Re-apply migrations (must be idempotent)
working-directory: backend
run: node prisma/migrate.js