-
Notifications
You must be signed in to change notification settings - Fork 2
118 lines (102 loc) · 3.99 KB
/
Copy pathvalidate.yml
File metadata and controls
118 lines (102 loc) · 3.99 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
name: validate
on:
push:
branches: [main]
pull_request:
paths:
- ".github/scripts/**"
- "**/*.md"
- "skills/**"
- "plugin-metadata.json"
- ".claude-plugin/**"
- ".cursor-plugin/**"
- ".github/workflows/validate.yml"
- ".github/lychee.toml"
workflow_dispatch:
jobs:
# Enumerate the skills so the validation job can fan out over them with a
# matrix. Running each skill in its own job (with fail-fast disabled) means
# one broken skill shows up as a single red check instead of failing the
# whole suite and hiding the status of every other skill.
discover-skills:
name: Discover skills
runs-on: ubuntu-latest
outputs:
skills: ${{ steps.discover.outputs.skills }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: List skills
id: discover
run: echo "skills=$(uv run .github/scripts/validate_skills.py --list)" >> "$GITHUB_OUTPUT"
validate-skill:
name: Validate skill
needs: discover-skills
runs-on: ubuntu-latest
strategy:
# Don't cancel the other skills when one fails; we want to see every
# skill's status in a single run.
fail-fast: false
matrix:
skill: ${{ fromJson(needs.discover-skills.outputs.skills) }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Validate skill
run: uv run .github/scripts/validate_skills.py --skill "${{ matrix.skill }}"
# Repo-wide checks that aren't tied to a single skill: the generated plugin
# manifests and internal markdown references.
validate-manifests:
name: Validate plugin manifests
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Validate marketplace manifest
run: uv run .github/scripts/validate_skills.py --marketplace-only
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install the claude CLI
run: npm install -g @anthropic-ai/claude-code
- name: Validate plugin with the claude CLI
run: claude plugin validate .
- name: Validate generated Cursor manifest
run: uv run .github/scripts/generate_cursor_marketplace.py --check
# Deterministic, offline-only reference check: relative paths and
# heading anchors. External URLs are intentionally not checked here
# because their failure modes are flaky; see
# `.github/workflows/external-reference-check.yml` for that.
- name: Check internal references and anchors
uses: lycheeverse/lychee-action@v2
with:
args: --config .github/lychee.toml --offline --include-fragments --no-progress "./**/*.md"
fail: true
# Single gate that aggregates the per-skill matrix and the repo-wide manifest
# checks. Branch protection can require just this one check: it only passes
# when every skill validated and the manifest job succeeded. Because matrix
# jobs always succeed individually under `fail-fast: false`, we inspect the
# job results explicitly rather than relying on `needs` short-circuiting.
validate:
name: Validate skills and plugin manifests
needs: [validate-skill, validate-manifests]
if: always()
runs-on: ubuntu-latest
steps:
- name: Verify all validation jobs passed
run: |
echo "validate-skill result: ${{ needs.validate-skill.result }}"
echo "validate-manifests result: ${{ needs.validate-manifests.result }}"
if [ "${{ needs.validate-skill.result }}" != "success" ] || \
[ "${{ needs.validate-manifests.result }}" != "success" ]; then
echo "One or more validation jobs failed." >&2
exit 1
fi
echo "All skill and manifest validations passed."