Skip to content

Commit 3b710ae

Browse files
committed
fix: CI — use standalone python script for eval validation, simplify bash
1 parent 7f405c5 commit 3b710ae

1 file changed

Lines changed: 13 additions & 51 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,94 +12,56 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15-
- name: Install PyYAML
16-
run: pip install pyyaml
17-
1815
- name: Validate SKILL.md front matter
16+
shell: bash
1917
run: |
2018
ERRORS=0
2119
for skill_dir in plan-product plan-eng code-review ship qa retro; do
2220
FILE="$skill_dir/SKILL.md"
2321
if [[ ! -f "$FILE" ]]; then
24-
echo " $skill_dir: SKILL.md missing"
22+
echo "FAIL $skill_dir: SKILL.md missing"
2523
ERRORS=$((ERRORS + 1))
2624
continue
2725
fi
2826
29-
# Check front matter exists
30-
if ! head -1 "$FILE" | grep -q '^---$'; then
31-
echo " $skill_dir: missing front matter"
27+
FIRST=$(head -1 "$FILE")
28+
if [[ "$FIRST" != "---" ]]; then
29+
echo "FAIL $skill_dir: missing front matter"
3230
ERRORS=$((ERRORS + 1))
3331
continue
3432
fi
3533
36-
# Extract front matter between first two ---
3734
FM=$(awk '/^---$/{n++; next} n==1{print} n==2{exit}' "$FILE")
3835
39-
# Check required fields
4036
HAS_NAME=$(echo "$FM" | grep -c '^name:' || true)
4137
HAS_DESC=$(echo "$FM" | grep -c '^description:' || true)
4238
4339
if [[ "$HAS_NAME" -eq 0 ]]; then
44-
echo " $skill_dir: front matter missing 'name'"
40+
echo "FAIL $skill_dir: missing name"
4541
ERRORS=$((ERRORS + 1))
4642
fi
4743
if [[ "$HAS_DESC" -eq 0 ]]; then
48-
echo " $skill_dir: front matter missing 'description'"
44+
echo "FAIL $skill_dir: missing description"
4945
ERRORS=$((ERRORS + 1))
5046
fi
5147
52-
# Check name matches directory
5348
FM_NAME=$(echo "$FM" | grep '^name:' | sed 's/name: *//' | tr -d '"' | tr -d "'")
5449
if [[ "$FM_NAME" != "$skill_dir" ]]; then
55-
echo " $skill_dir: name '$FM_NAME' doesn't match directory"
50+
echo "FAIL $skill_dir: name mismatch ($FM_NAME)"
5651
ERRORS=$((ERRORS + 1))
5752
else
58-
echo " $skill_dir: OK"
53+
echo "OK $skill_dir"
5954
fi
6055
done
6156
6257
if [[ $ERRORS -gt 0 ]]; then
63-
echo ""
64-
echo "$ERRORS error(s) found."
58+
echo "$ERRORS error(s)"
6559
exit 1
6660
fi
61+
echo "All skills validated."
6762
6863
- name: Validate eval test cases
69-
run: |
70-
ERRORS=0
71-
for skill_dir in plan-product plan-eng code-review ship qa retro; do
72-
EVAL="$skill_dir/evals/test_cases.yaml"
73-
if [[ ! -f "$EVAL" ]]; then
74-
echo "❌ $skill_dir: evals/test_cases.yaml missing"
75-
ERRORS=$((ERRORS + 1))
76-
continue
77-
fi
78-
79-
python3 << PYEOF
80-
import yaml, sys
81-
with open("$EVAL") as f:
82-
data = yaml.safe_load(f)
83-
if not isinstance(data, list):
84-
print("❌ $skill_dir: test_cases.yaml must be a list")
85-
sys.exit(1)
86-
for i, case in enumerate(data):
87-
for field in ["id", "prompt", "expectations"]:
88-
if field not in case or not case[field]:
89-
print(f"❌ $skill_dir: case {i} missing {field}")
90-
sys.exit(1)
91-
print(f"✅ $skill_dir: {len(data)} test case(s) valid")
92-
PYEOF
93-
if [[ $? -ne 0 ]]; then
94-
ERRORS=$((ERRORS + 1))
95-
fi
96-
done
97-
98-
if [[ $ERRORS -gt 0 ]]; then
99-
echo ""
100-
echo "$ERRORS error(s) found."
101-
exit 1
102-
fi
64+
run: python3 scripts/validate-evals.py
10365

10466
- name: Check setup script syntax
105-
run: bash -n setup && echo " setup: syntax OK"
67+
run: bash -n setup && echo "OK setup"

0 commit comments

Comments
 (0)