-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (113 loc) · 4.08 KB
/
ci.yml
File metadata and controls
125 lines (113 loc) · 4.08 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate hook syntax (bash -n)
run: |
echo "── Hook Syntax ──"
ERRORS=0
for f in template/hooks/*.sh stacks/*/hooks/*.sh hooks/*.sh; do
[ -f "$f" ] || continue
if bash -n "$f" 2>&1; then
echo "✓ $f"
else
echo "✗ $f"
ERRORS=$((ERRORS + 1))
fi
done
echo ""
echo "Checked: $(find template/hooks stacks/*/hooks hooks -name '*.sh' 2>/dev/null | wc -l) files"
[ $ERRORS -eq 0 ] || exit 1
- name: Validate hook permissions
run: |
echo "── Hook Permissions ──"
ERRORS=0
for f in template/hooks/*.sh stacks/*/hooks/*.sh hooks/*.sh; do
[ -f "$f" ] || continue
if [ -x "$f" ]; then
echo "✓ $f"
else
echo "✗ $f (not executable)"
ERRORS=$((ERRORS + 1))
fi
done
[ $ERRORS -eq 0 ] || exit 1
- name: Validate YAML files
run: |
echo "── YAML Validation ──"
python3 -c "import yaml; yaml.safe_load(open('registry/projects.yml')); print('✓ registry/projects.yml')"
python3 -c "import yaml; yaml.safe_load(open('practices/sources.yml')); print('✓ practices/sources.yml')"
python3 -c "import yaml; yaml.safe_load(open('practices/metrics.yml')); print('✓ practices/metrics.yml')"
- name: Validate rules frontmatter
run: |
echo "── Rules Frontmatter ──"
bash tests/lint-rules.sh
- name: Validate stack completeness
run: |
echo "── Stack Completeness ──"
ERRORS=0
for d in stacks/*/; do
[ -f "${d}detect.md" ] && continue # skip detect.md metadata file
STACK=$(basename "$d")
MISSING=""
[ -d "${d}rules" ] || MISSING="rules/"
[ -f "${d}settings.json.partial" ] || MISSING="$MISSING settings.json.partial"
if [ -n "$MISSING" ]; then
echo "✗ $STACK — missing: $MISSING"
ERRORS=$((ERRORS + 1))
else
echo "✓ $STACK"
fi
done
[ $ERRORS -eq 0 ] || exit 1
- name: Validate skill completeness
run: |
echo "── Skill Completeness ──"
ERRORS=0
for d in skills/*/; do
SKILL=$(basename "$d")
if [ ! -f "${d}SKILL.md" ]; then
echo "✗ $SKILL — missing SKILL.md"
ERRORS=$((ERRORS + 1))
else
echo "✓ $SKILL"
fi
done
[ $ERRORS -eq 0 ] || exit 1
- name: Validate benchmark tasks
run: |
echo "── Benchmark Tasks ──"
python3 -c "
import yaml, glob, sys
errors = 0
for f in sorted(glob.glob('tests/benchmark-tasks/*.yml')):
try:
data = yaml.safe_load(open(f))
assert 'id' in data, 'missing id'
assert 'stack' in data, 'missing stack'
assert 'prompt' in data, 'missing prompt'
print(f'✓ {f}')
except Exception as e:
print(f'✗ {f}: {e}')
errors += 1
sys.exit(errors)
"
- name: Version consistency check
run: |
echo "── Version Consistency ──"
VERSION=$(cat VERSION | tr -d '[:space:]')
echo "VERSION file: $VERSION"
PLUGIN_VERSION=$(python3 -c "import json; print(json.load(open('.claude-plugin/plugin.json'))['version'])")
echo "plugin.json: $PLUGIN_VERSION"
if [ "$VERSION" != "$PLUGIN_VERSION" ]; then
echo "✗ Version mismatch: VERSION=$VERSION, plugin.json=$PLUGIN_VERSION"
exit 1
fi
echo "✓ Versions match"