This repository was archived by the owner on Feb 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
258 lines (226 loc) · 8.17 KB
/
Copy pathci.yml
File metadata and controls
258 lines (226 loc) · 8.17 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
name: CI
on:
workflow_dispatch:
push:
branches:
- 'claude/**'
paths-ignore:
- '**.md'
- 'docs/**'
- '.vscode/**'
- '.idea/**'
- 'LICENSE'
- '.gitignore'
pull_request:
branches:
- main
- 'claude/**'
paths-ignore:
- '**.md'
- 'docs/**'
- '.vscode/**'
- '.idea/**'
- 'LICENSE'
- '.gitignore'
# Cancel in-progress runs for the same PR/branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
jobs:
# Detect which packages changed to optimize test runs
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }}
shared: ${{ steps.filter.outputs.shared }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check for file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
backend:
- 'packages/backend/**'
- 'packages/shared/**'
- 'package.json'
- 'package-lock.json'
frontend:
- 'packages/frontend/**'
- 'packages/shared/**'
- 'package.json'
- 'package-lock.json'
shared:
- 'packages/shared/**'
- 'package.json'
- 'package-lock.json'
# Shared package tests
test-shared:
name: Test Shared Package
needs: changes
if: needs.changes.outputs.shared == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build shared package
run: npm run build:shared
- name: Run shared tests with coverage
run: npm run test:coverage:shared
- name: Display coverage summary
if: always()
run: |
echo "## 📊 Shared Package Coverage" >> $GITHUB_STEP_SUMMARY
if [ -f packages/shared/coverage/coverage-summary.json ]; then
node -e "
const data = require('./packages/shared/coverage/coverage-summary.json');
const total = data.total;
console.log('| Metric | Coverage |');
console.log('|--------|----------|');
console.log('| Lines | ' + total.lines.pct + '% |');
console.log('| Statements | ' + total.statements.pct + '% |');
console.log('| Functions | ' + total.functions.pct + '% |');
console.log('| Branches | ' + total.branches.pct + '% |');
" >> $GITHUB_STEP_SUMMARY
else
echo "No coverage data available (no tests or coverage not generated)" >> $GITHUB_STEP_SUMMARY
fi
- name: Upload test coverage
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: shared-coverage
path: packages/shared/coverage/
retention-days: 7
if-no-files-found: ignore
# Backend tests
test-backend:
name: Test Backend
needs: changes
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['22', '24']
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build shared package
run: npm run build:shared
- name: Install Playwright browsers
run: npx playwright install chromium --with-deps
working-directory: packages/backend
- name: Run backend tests with coverage
run: npm run test:coverage:backend
- name: Display coverage summary
if: always() && matrix.node-version == '22'
run: |
echo "## 📊 Backend Package Coverage" >> $GITHUB_STEP_SUMMARY
if [ -f packages/backend/coverage/coverage-summary.json ]; then
node -e "
const data = require('./packages/backend/coverage/coverage-summary.json');
const total = data.total;
console.log('| Metric | Coverage |');
console.log('|--------|----------|');
console.log('| Lines | ' + total.lines.pct + '% |');
console.log('| Statements | ' + total.statements.pct + '% |');
console.log('| Functions | ' + total.functions.pct + '% |');
console.log('| Branches | ' + total.branches.pct + '% |');
" >> $GITHUB_STEP_SUMMARY
else
echo "No coverage data available" >> $GITHUB_STEP_SUMMARY
fi
- name: Upload test coverage
if: matrix.node-version == '22'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: backend-coverage
path: packages/backend/coverage/
retention-days: 7
if-no-files-found: ignore
# Frontend tests
test-frontend:
name: Test Frontend
needs: changes
if: needs.changes.outputs.frontend == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build shared package
run: npm run build:shared
- name: Run frontend tests with coverage
run: npm run test:coverage:frontend
- name: Display coverage summary
if: always()
run: |
echo "## 📊 Frontend Package Coverage" >> $GITHUB_STEP_SUMMARY
if [ -f packages/frontend/coverage/coverage-summary.json ]; then
node -e "
const data = require('./packages/frontend/coverage/coverage-summary.json');
const total = data.total;
console.log('| Metric | Coverage |');
console.log('|--------|----------|');
console.log('| Lines | ' + total.lines.pct + '% |');
console.log('| Statements | ' + total.statements.pct + '% |');
console.log('| Functions | ' + total.functions.pct + '% |');
console.log('| Branches | ' + total.branches.pct + '% |');
" >> $GITHUB_STEP_SUMMARY
else
echo "No coverage data available (no tests or coverage not generated)" >> $GITHUB_STEP_SUMMARY
fi
- name: Upload test coverage
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: frontend-coverage
path: packages/frontend/coverage/
retention-days: 7
if-no-files-found: ignore
# Lint and format check
lint:
name: Lint & Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run biome CI check
run: npx -y @biomejs/biome@2.3.11 ci
# Security audit
security:
name: Security Audit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '22'
- name: Run npm audit
run: npm audit --audit-level=moderate