-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (76 loc) · 2.27 KB
/
Copy pathci.yml
File metadata and controls
88 lines (76 loc) · 2.27 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
skill-frontmatter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate SKILL.md frontmatter
run: |
fail=0
for f in skills/*/SKILL.md; do
# Extract YAML between --- delimiters
fm=$(awk '/^---$/{if(n++)exit;next}n' "$f")
if [ -z "$fm" ]; then
echo "FAIL: $f - no frontmatter"
fail=1
continue
fi
# Check name and description exist
name=$(echo "$fm" | grep -oP '^name:\s*\K.*' | sed 's/^["'"'"']//;s/["'"'"']$//')
desc=$(echo "$fm" | grep -oP '^description:\s*\K.*' | sed 's/^["'"'"']//;s/["'"'"']$//')
if [ -z "$name" ] || [ -z "$desc" ]; then
echo "FAIL: $f - missing name or description"
fail=1
continue
fi
# Validate YAML parses (catch unquoted colons etc.)
if ! echo "$fm" | python3 -c "import sys,yaml; yaml.safe_load(sys.stdin)" 2>/tmp/yaml-err; then
echo "FAIL: $f - invalid YAML: $(cat /tmp/yaml-err)"
fail=1
continue
fi
echo "OK: $f ($name)"
done
exit $fail
build-and-lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
module:
- .
- memory/tools/knowledge-sync
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.24"
cache: false
- name: Test
working-directory: ${{ matrix.module }}
run: go test ./...
- name: Build
working-directory: ${{ matrix.module }}
run: go build ./...
- name: Vet
working-directory: ${{ matrix.module }}
run: go vet ./...
- name: Lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.12.2
working-directory: ${{ matrix.module }}
npm-wrapper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Test npm wrapper
run: node --test npm/install.test.js