-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (136 loc) · 5 KB
/
Copy pathci.yaml
File metadata and controls
152 lines (136 loc) · 5 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
name: 🧪 CI
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
permissions: {}
jobs:
validate-manifests:
name: Validate manifests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: 📄 Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: ✅ Validate manifests
# Single source of truth in scripts/validate-manifests.sh (documented in
# AGENTS.md, self-tested in the lint-scripts job) — no inline/doc drift.
run: ./scripts/validate-manifests.sh
lint-scripts:
name: Lint scripts
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: 📄 Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 🐚 ShellCheck scripts
run: shellcheck scripts/*.sh
- name: 🧪 Self-test the manifest guard
# Proves validate-manifests.sh PASSES a consistent fixture and FAILS each
# drift scenario it exists to catch (malformed/desynced manifests, every
# plugin.json completeness rule, every manifest↔plugins lockstep rule), so
# a refactor that silently weakens a check is caught here — not by a broken
# plugin reaching consumers. Self-contained: throwaway fixtures, no network.
run: ./scripts/validate-manifests.test.sh
- name: 🧪 Self-test skill helper scripts
# Runs every hermetic *.test.sh bundled alongside a skill's helper scripts
# (plugins/**/skills/**/scripts/), so a regression in a script that ships
# to users is caught here rather than mid-audit. New script tests are picked
# up automatically — no workflow edit needed. Self-contained: each test
# stubs its external tools (no network, no cluster).
run: |
shopt -s nullglob
tests=(plugins/*/skills/*/scripts/*.test.sh)
if [ ${#tests[@]} -eq 0 ]; then
echo "No skill helper-script self-tests found."
exit 0
fi
for t in "${tests[@]}"; do
echo "::group::$t"
bash "$t"
echo "::endgroup::"
done
discover-skills:
name: Discover skills
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
skills: ${{ steps.list.outputs.skills }}
steps:
- name: 📄 Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 📂 List skill directories
id: list
run: |
skills=$(find plugins -mindepth 4 -maxdepth 4 -name SKILL.md -printf '%h\n' \
| sed 's|^\./||' \
| sort \
| jq -R -s -c 'split("\n") | map(select(length > 0))')
if ! jq -e 'type == "array"' >/dev/null 2>&1 <<<"$skills"; then
echo "::error::Skill discovery produced invalid output."
exit 1
fi
echo "skills=$skills" >> "$GITHUB_OUTPUT"
echo "Discovered: $skills"
validate-spec:
name: Validate spec (${{ matrix.skill }})
needs: discover-skills
if: needs.discover-skills.outputs.skills != '[]'
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
skill: ${{ fromJson(needs.discover-skills.outputs.skills) }}
steps:
- name: 📄 Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 🐍 Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: 📦 Install skills-ref
env:
AGENTSKILLS_REF: 8d8fcbc69e0c42e05922c2ffc287a3bbdef7b0a3
run: |
python -m pip install --disable-pip-version-check \
"skills-ref @ git+https://github.com/agentskills/agentskills.git@${AGENTSKILLS_REF}#subdirectory=skills-ref"
- name: ✅ Validate ${{ matrix.skill }} against agentskills.io spec
env:
SKILL: ${{ matrix.skill }}
run: skills-ref validate "$SKILL"
ci-required-checks:
name: CI - Required Checks
runs-on: ubuntu-latest
permissions:
checks: read
statuses: read
pull-requests: read
timeout-minutes: 5
needs: [validate-manifests, lint-scripts, discover-skills, validate-spec]
if: ${{ always() }}
steps:
- uses: devantler-tech/actions/require-checks-in-pr@1f66c91d45d374ceac9fe830a783444ebc9be958 # v3.2.0
with:
job-results: >-
${{ needs.validate-manifests.result }}
${{ needs.lint-scripts.result }}
${{ needs.discover-skills.result }}
${{ needs.validate-spec.result }}