This repository was archived by the owner on May 31, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
463 lines (392 loc) · 14.3 KB
/
Copy pathci.yml
File metadata and controls
463 lines (392 loc) · 14.3 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Backend jobs
backend-lint:
name: Backend Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
version: latest
enable-cache: true
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
- name: Install dependencies
working-directory: ./backend
run: uv sync
- name: Run ruff check
working-directory: ./backend
run: uv run ruff check .
- name: Run ruff format check
working-directory: ./backend
run: uv run ruff format --check .
backend-test:
name: Backend Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:18@sha256:52e6ffd11fddd081ae63880b635b2a61c14008c17fc98cdc7ce5472265516dd0
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
version: latest
enable-cache: true
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
- name: Install dependencies
working-directory: ./backend
run: uv sync
- name: Run tests
working-directory: ./backend
env:
DATABASE_URL: postgresql+psycopg://postgres:postgres@localhost:5432/test_db
run: uv run pytest -v --cov=app --cov-report=xml
backend-migrations:
name: Backend Migrations Check
runs-on: ubuntu-latest
services:
postgres:
image: postgres:18@sha256:52e6ffd11fddd081ae63880b635b2a61c14008c17fc98cdc7ce5472265516dd0
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
version: latest
enable-cache: true
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
- name: Install dependencies
working-directory: ./backend
run: uv sync
- name: Check migrations
working-directory: ./backend
env:
DATABASE_URL: postgresql+psycopg://postgres:postgres@localhost:5432/test_db
run: uv run litestar database upgrade --no-prompt
# Admin Portal jobs
admin-portal-lint:
name: Admin Portal Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
with:
version: "10"
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "24"
cache: pnpm
cache-dependency-path: admin_portal/pnpm-lock.yaml
- name: Install dependencies
working-directory: ./admin_portal
run: pnpm install --frozen-lockfile
- name: Run Biome lint
working-directory: ./admin_portal
run: pnpm run lint:ci
- name: Run Prettier check
working-directory: ./admin_portal
run: pnpm run format:check
# admin-portal-test:
# name: Admin Portal Tests
# runs-on: ubuntu-latest
# services:
# postgres:
# image: postgres:18@sha256:5773fe724c49c42a7a9ca70202e11e1dff21fb7235b335a73f39297d200b73a2
# env:
# POSTGRES_PASSWORD: postgres
# POSTGRES_DB: test_db
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
# ports:
# - 5432:5432
# steps:
# - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
# - name: Install uv
# uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
# with:
# version: latest
# enable-cache: true
# - name: Set up Python
# uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
# with:
# python-version: "3.13"
# - name: Install dependencies
# working-directory: ./backend
# run: uv sync
# - name: Upgrade database
# working-directory: ./backend
# env:
# DATABASE_URL: postgresql+psycopg://postgres:postgres@localhost:5432/test_db
# run: uv run litestar database upgrade --no-prompt
# - name: Start backend server
# working-directory: ./backend
# env:
# DATABASE_URL: postgresql+psycopg://postgres:postgres@localhost:5432/test_db
# PUBLIC_BASE_URL: http://127.0.0.1:8000
# ADMIN_BASE_URL: http://127.0.0.1:3002
# FRONTEND_BASE_URL: http://127.0.0.1:4321
# run: uv run litestar run --host 127.0.0.1 --port 8000 > /tmp/backend.log 2>&1 &
# - name: Wait for backend
# run: |
# for i in $(seq 1 30); do
# if curl -sf http://127.0.0.1:8000/api/v1/health > /dev/null 2>&1; then
# echo "Backend is ready"
# break
# fi
# echo "Waiting for backend... attempt $i"
# sleep 2
# done
# curl -sf http://127.0.0.1:8000/api/v1/health || (echo "Backend failed to start"; cat /tmp/backend.log; exit 1)
# - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
# with:
# version: "10"
# - name: Setup Node.js
# uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
# with:
# node-version: "24"
# cache: pnpm
# cache-dependency-path: admin_portal/pnpm-lock.yaml
# - name: Install dependencies
# working-directory: ./admin_portal
# run: pnpm install --frozen-lockfile
# - name: Build admin portal
# working-directory: ./admin_portal
# env:
# VITE_API_BASE_URL: http://127.0.0.1:8000
# run: pnpm run build
# # - name: Start admin portal server
# # working-directory: ./admin_portal
# # run: npx http-server dist -p 3002 -s > /tmp/admin_portal.log 2>&1 &
# # - name: Wait for admin portal
# # run: |
# # for i in $(seq 1 30); do
# # if curl -sf http://127.0.0.1:3002/ > /dev/null 2>&1; then
# # echo "Admin portal is ready"
# # break
# # fi
# # echo "Waiting for admin portal... attempt $i"
# # sleep 2
# # done
# # curl -sf http://127.0.0.1:3002/ || (echo "Admin portal failed to start"; cat /tmp/admin_portal.log; exit 1)
# - name: Install Playwright browsers
# working-directory: ./admin_portal
# run: pnpm exec playwright install --with-deps
# - name: Run tests
# working-directory: ./admin_portal
# env:
# DATABASE_URL: postgresql+psycopg://postgres:postgres@localhost:5432/test_db
# VITE_API_BASE_URL: http://127.0.0.1:8000
# run: pnpm run test
admin-portal-build:
name: Admin Portal Build
runs-on: ubuntu-latest
needs: admin-portal-lint
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
with:
version: "10"
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "24"
cache: pnpm
cache-dependency-path: admin_portal/pnpm-lock.yaml
- name: Install dependencies
working-directory: ./admin_portal
run: pnpm install --frozen-lockfile
- name: Build
working-directory: ./admin_portal
run: pnpm run build
# Frontend jobs
frontend-lint:
name: Frontend Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
with:
version: "10"
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "24"
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
working-directory: ./frontend
run: pnpm install --frozen-lockfile
- name: Run Biome lint
working-directory: ./frontend
run: pnpm run lint:ci
- name: Run Prettier check
working-directory: ./frontend
run: pnpm run format:check
- name: Run Astro check
working-directory: ./frontend
run: pnpm run check
# frontend-test:
# name: Frontend Tests
# runs-on: ubuntu-latest
# services:
# postgres:
# image: postgres:18@sha256:5773fe724c49c42a7a9ca70202e11e1dff21fb7235b335a73f39297d200b73a2
# env:
# POSTGRES_PASSWORD: postgres
# POSTGRES_DB: test_db
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
# ports:
# - 5432:5432
# steps:
# - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
# - name: Install uv
# uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
# with:
# version: latest
# enable-cache: true
# - name: Set up Python
# uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
# with:
# python-version: "3.13"
# - name: Install dependencies
# working-directory: ./backend
# run: uv sync
# - name: Upgrade database
# working-directory: ./backend
# env:
# DATABASE_URL: postgresql+psycopg://postgres:postgres@localhost:5432/test_db
# run: uv run litestar database upgrade --no-prompt
# - name: Start backend server
# working-directory: ./backend
# env:
# DATABASE_URL: postgresql+psycopg://postgres:postgres@localhost:5432/test_db
# PUBLIC_BASE_URL: http://127.0.0.1:8000
# ADMIN_BASE_URL: http://127.0.0.1:3002
# FRONTEND_BASE_URL: http://127.0.0.1:4321
# run: uv run litestar run --host 127.0.0.1 --port 8000 > /tmp/backend.log 2>&1 &
# - name: Wait for backend
# run: |
# for i in $(seq 1 30); do
# if curl -sf http://127.0.0.1:8000/api/v1/health > /dev/null 2>&1; then
# echo "Backend is ready"
# break
# fi
# echo "Waiting for backend... attempt $i"
# sleep 2
# done
# curl -sf http://127.0.0.1:8000/api/v1/health || (echo "Backend failed to start"; cat /tmp/backend.log; exit 1)
# - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
# with:
# version: "10"
# - name: Setup Node.js
# uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
# with:
# node-version: "24"
# cache: pnpm
# cache-dependency-path: frontend/pnpm-lock.yaml
# - name: Install frontend dependencies
# working-directory: ./frontend
# run: pnpm install --frozen-lockfile
# - name: Build frontend
# working-directory: ./frontend
# env:
# PUBLIC_BASE_URL: http://127.0.0.1:8000
# run: pnpm run build
# # - name: Start frontend server
# # working-directory: ./frontend
# # run: node ./dist/server/entry.mjs > /tmp/frontend.log 2>&1 &
# # env:
# # HOST: 127.0.0.1
# # PORT: 4321
# # - name: Wait for frontend
# # run: |
# # for i in $(seq 1 30); do
# # if curl -sf http://127.0.0.1:4321/ > /dev/null 2>&1; then
# # echo "Frontend is ready"
# # break
# # fi
# # echo "Waiting for frontend... attempt $i"
# # sleep 2
# # done
# # curl -sf http://127.0.0.1:4321/ || (echo "Frontend failed to start"; cat /tmp/frontend.log; exit 1)
# - name: Install Playwright browsers
# working-directory: ./frontend
# run: pnpm exec playwright install --with-deps
# - name: Run e2e tests
# working-directory: ./frontend
# env:
# CI: true
# DATABASE_URL: postgresql+psycopg://postgres:postgres@localhost:5432/test_db
# PUBLIC_BASE_URL: http://127.0.0.1:8000
# PLAYWRIGHT_BASE_URL: http://127.0.0.1:4321
# run: pnpm run test:e2e
frontend-build:
name: Frontend Build
runs-on: ubuntu-latest
needs: frontend-lint
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
with:
version: "10"
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "24"
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
working-directory: ./frontend
run: pnpm install --frozen-lockfile
- name: Build
working-directory: ./frontend
run: pnpm run build