76 lines
2.4 KiB
YAML
76 lines
2.4 KiB
YAML
name: Validate & Test Skills
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master ]
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
|
|
# The validation job only reads the checkout; it never needs to write to the repository.
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
validate-and-test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 25
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ["3.10", "3.12", "3.13"]
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v7
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements-dev.txt
|
|
|
|
- name: Validate skill structure, frontmatter, cross-references and packaging
|
|
run: python tools/validate_skills.py
|
|
|
|
# skills-ref requires Python 3.11+, while this library supports 3.10+, so the
|
|
# specification check runs on the newer interpreters only.
|
|
- name: Install the agentskills.io reference validator
|
|
if: matrix.python-version != '3.10'
|
|
run: pip install skills-ref
|
|
|
|
- name: Validate against the agentskills.io specification
|
|
if: matrix.python-version != '3.10'
|
|
run: |
|
|
python - <<'EOF'
|
|
import os, sys
|
|
from skills_ref import validate
|
|
failed = 0
|
|
for name in sorted(os.listdir("skills")):
|
|
errors = validate(os.path.join("skills", name))
|
|
if errors:
|
|
failed += 1
|
|
print(f"{name}:")
|
|
for e in errors:
|
|
print(f" - {e}")
|
|
total = len(os.listdir("skills"))
|
|
print(f"{total} skills checked, {failed} failed the agentskills.io specification.")
|
|
sys.exit(1 if failed else 0)
|
|
EOF
|
|
|
|
- name: Check generated files are current (index.json, marketplace.json)
|
|
run: |
|
|
python tools/build_index.py --check
|
|
python tools/build_marketplace.py --check
|
|
|
|
- name: Run repository tests
|
|
run: python -m unittest discover -s tests -v
|
|
|
|
- name: Run every skill's unit test suite
|
|
run: python tools/run_all_tests.py --quiet --timeout 120
|
|
|
|
- name: Run the cookbook examples
|
|
run: |
|
|
for f in examples/*.py; do python "$f" > /dev/null || exit 1; done
|