Repository navigation
80 lines (72 loc) · 2.86 KB
/
Copy pathci.yml
File metadata and controls
80 lines (72 loc) · 2.86 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
name: CI
on:
push:
branches: [master]
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm run lint
- run: npm run test
# P1-4: 构建验证 — 确保 dist 可编译
- run: npm run build
# P0-1: SKILL.md 与 flows 一致性检查(防双源漂移)
- run: npx tsx src/index.ts generate-skill --check
# C2: .harness.md 与命令注册表一致性检查(防工具清单漂移)
- run: npm run harness:check
# 批次E16: e2e 冒烟测试 — 验证 sandbox→init-task→preflight-check→validate-spec→checkpoint 链路
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: e2e smoke test
run: |
SANDBOX="/tmp/uv-e2e-$(date +%s)"
echo "=== E2E: 创建沙箱 ==="
npx tsx src/index.ts sandbox --dir "$SANDBOX" --flow feature --description "e2e smoke test"
test -f "$SANDBOX/.reports/task.json" || { echo "FAIL: task.json 缺失"; exit 1; }
test -f "$SANDBOX/.reports/checkpoint-summary.json" || { echo "FAIL: checkpoint 缺失"; exit 1; }
echo "OK: 沙箱创建成功"
echo "=== E2E: preflight-check ==="
npx tsx src/index.ts preflight-check --workdir "$SANDBOX" || { echo "FAIL: preflight-check"; exit 1; }
echo "OK: preflight-check 通过"
echo "=== E2E: checkpoint read ==="
npx tsx src/index.ts checkpoint read --workdir "$SANDBOX" || { echo "FAIL: checkpoint read"; exit 1; }
CP_NEXT=$(node -e "console.log(JSON.parse(require('fs').readFileSync('$SANDBOX/.reports/checkpoint-summary.json','utf8')).next_phase)")
echo "next_phase=$CP_NEXT"
[ "$CP_NEXT" = "FE-1" ] || { echo "FAIL: next_phase 应为 FE-1, 实际为 $CP_NEXT"; exit 1; }
echo "OK: checkpoint 正确"
echo "=== E2E: 写入 frozen-spec.json ==="
cat > "$SANDBOX/.reports/frozen-spec.json" << 'JSONEOF'
{
"version": 1,
"title": "e2e smoke test",
"requirements": [
{
"req_id": "REQ-001",
"title": "test requirement",
"scope": ["src/"]
}
],
"protected_files": [],
"forbidden_scope": []
}
JSONEOF
echo "OK: frozen-spec.json 写入"
echo "=== E2E: validate-spec ==="
npx tsx src/index.ts validate-spec --workdir "$SANDBOX" || { echo "FAIL: validate-spec"; exit 1; }
echo "OK: validate-spec 通过"
echo "=== E2E: 全部通过 ==="