-
Notifications
You must be signed in to change notification settings - Fork 0
291 lines (250 loc) · 8.63 KB
/
Copy pathci.yml
File metadata and controls
291 lines (250 loc) · 8.63 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
name: Validate Structure
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v7
- name: Check shell script syntax
run: |
errors=0
for f in scripts/*.sh; do
if [ -f "$f" ]; then
bash -n "$f" || { echo "FAIL: $f"; errors=$((errors + 1)); }
fi
done
echo "Checked $(ls scripts/*.sh 2>/dev/null | wc -l) scripts, $errors failed"
exit $errors
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: './scripts'
severity: warning
- name: Validate JSON configs
run: |
errors=0
for f in .claude/pipeline.config.json package.json; do
if [ -f "$f" ]; then
python3 -m json.tool "$f" > /dev/null || { echo "FAIL: $f"; errors=$((errors + 1)); }
fi
done
for f in templates/**/*.json; do
if [ -f "$f" ]; then
python3 -m json.tool "$f" > /dev/null || { echo "FAIL: $f"; errors=$((errors + 1)); }
fi
done
echo "$errors JSON validation failures"
exit $errors
- name: Validate pipeline.config.json structure
run: |
required_keys='["tdd","database","auth","testing","qualityGate","deployment","security","api"]'
python3 -c "
import json, sys
with open('.claude/pipeline.config.json') as f:
config = json.load(f)
required = json.loads('$required_keys')
missing = [k for k in required if k not in config]
if missing:
print(f'Missing required keys: {missing}')
sys.exit(1)
print(f'All {len(required)} required keys present')
"
- name: Check required files exist
run: |
exit_code=0
required_files=(
"CLAUDE.md"
"package.json"
"CONTRIBUTING.md"
"CODE_OF_CONDUCT.md"
"SECURITY.md"
"LICENSE"
".claude/pipeline.config.json"
"scripts/setup-project.sh"
"scripts/run-tests.sh"
"scripts/check-types.sh"
"scripts/security-scan.sh"
"scripts/generate-migration.sh"
)
for f in "${required_files[@]}"; do
if [ -f "$f" ]; then
echo " $f: OK"
else
echo " $f: MISSING"
exit_code=1
fi
done
exit $exit_code
- name: Validate agent frontmatter
run: |
errors=0
count=0
for f in .claude/agents/*.md; do
[ -f "$f" ] || continue
count=$((count + 1))
frontmatter=$(sed -n '/^---$/,/^---$/p' "$f" | sed '1d;$d')
if [ -z "$frontmatter" ]; then
echo "FAIL: $f — no YAML frontmatter found"
errors=$((errors + 1))
continue
fi
for field in name description; do
if ! echo "$frontmatter" | grep -qE "^${field}:"; then
echo "FAIL: $f — missing required field: $field"
errors=$((errors + 1))
fi
done
done
echo "Checked $count agents, $errors failures"
exit $errors
- name: Validate skill structure
run: |
errors=0
count=0
for dir in .claude/skills/*/; do
[ -d "$dir" ] || continue
count=$((count + 1))
skill_file="${dir}SKILL.md"
if [ ! -f "$skill_file" ]; then
echo "FAIL: $dir — missing SKILL.md"
errors=$((errors + 1))
continue
fi
frontmatter=$(sed -n '/^---$/,/^---$/p' "$skill_file" | sed '1d;$d')
if [ -z "$frontmatter" ]; then
echo "FAIL: $skill_file — no frontmatter found"
errors=$((errors + 1))
continue
fi
for field in name description; do
if ! echo "$frontmatter" | grep -qE "^${field}:"; then
echo "FAIL: $skill_file — missing required field: $field"
errors=$((errors + 1))
fi
done
done
echo "Checked $count skills, $errors failures"
exit $errors
- name: Validate templates
run: |
errors=0
for f in templates/**/*.json; do
if [ -f "$f" ]; then
python3 -m json.tool "$f" > /dev/null 2>&1 || {
echo "FAIL: $f — invalid JSON"
errors=$((errors + 1))
}
fi
done
for dir in templates/shared templates/cloudflare-workers templates/node-server templates/docker templates/aws-lambda templates/railway templates/fly templates/multi-tenant; do
if [ -d "$dir" ]; then
echo " $dir: OK"
else
echo " $dir: MISSING"
errors=$((errors + 1))
fi
done
echo "$errors template validation failures"
exit $errors
node-compat:
name: Node.js ${{ matrix.node-version }} Compatibility
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
node-version: [20, 22]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
- run: corepack enable
- run: pnpm install
- name: Verify installation
run: |
echo "Node.js version: $(node --version)"
echo "pnpm version: $(pnpm --version)"
pnpm ls --depth 0
typecheck-templates:
name: Type-check Embedded Templates
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
- run: corepack enable
- name: Install typecheck dependencies
run: pnpm install --frozen-lockfile
working-directory: templates/snippets
- name: Type-check Cloudflare snippets
run: pnpm exec tsc --noEmit -p tsconfig.cloudflare.json
working-directory: templates/snippets
- name: Type-check Node snippets
run: pnpm exec tsc --noEmit -p tsconfig.node.json
working-directory: templates/snippets
- name: Type-check AWS Lambda snippets
run: pnpm exec tsc --noEmit -p tsconfig.lambda.json
working-directory: templates/snippets
# Generates a real project per target with setup-project.sh and type-checks
# it. Unlike typecheck-templates this has no lockfile on purpose: it installs
# whatever `pnpm add` resolves today, so a dependency release that breaks
# freshly generated projects (e.g. the TypeScript 6 @types auto-include
# removal, #119) fails here instead of only on user machines.
generated-projects:
name: Generate & Type-check (${{ matrix.label }})
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- { platform: cloudflare, label: cloudflare }
- { platform: node, label: node }
- { platform: lambda, label: lambda }
- { platform: railway, label: railway }
- { platform: fly, label: fly }
# Multi-tenant variant: also runs the tenant-isolation tests, since
# the tenancy scaffolding ships its own test suite.
- { platform: node, label: node-multi-tenant, flags: --multi-tenant }
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
- run: corepack enable
- name: Generate project
run: ./scripts/setup-project.sh demo-${{ matrix.label }} --${{ matrix.platform }} ${{ matrix.flags }}
- name: Type-check generated project
run: pnpm typecheck
working-directory: demo-${{ matrix.label }}/api
- name: Run tenant-isolation tests
if: matrix.flags == '--multi-tenant'
run: pnpm test
working-directory: demo-${{ matrix.label }}/api
check-links:
name: Check Markdown Links
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- name: Check markdown links
uses: lycheeverse/lychee-action@v2
with:
args: >-
--verbose
--no-progress
--config .lychee.toml
'*.md'
'docs/**/*.md'
fail: true