Files
SkillCompiler/data/skills-bench/.github/workflows/ci.yml
T
2026-09-04 14:58:42 +08:00

55 lines
2.1 KiBLFS
YAML

name: ci
on:
pull_request:
merge_group:
push:
branches: [main]
jobs:
# Required merge-queue gate: every task directory must keep the native task.md
# structure.
validate-tasks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install PyYAML (task.md frontmatter parsing)
run: python3 -m pip install pyyaml
- name: Validate task structure
run: python3 .github/scripts/validate_tasks.py tasks tasks-extra
- name: Validate skill frontmatter
run: python3 .github/scripts/lint_skill_frontmatter.py
- name: Test skill frontmatter linter
run: python3 .github/scripts/test_lint_skill_frontmatter.py
# Lints only the Python files this PR changed, so the repo's pre-existing
# ruff debt does not block merges — it gets paid down as files are touched.
# Scoped this way the check is safe to promote to a required merge-queue
# gate (see the main-merge-queue ruleset).
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v5
- name: Ruff (changed Python files)
run: |
case "${{ github.event_name }}" in
merge_group) base="${{ github.event.merge_group.base_sha }}" ;;
pull_request) base="${{ github.event.pull_request.base.sha }}" ;;
*) base="$(git rev-parse HEAD~1)" ;; # push: best-effort (last commit)
esac
# NUL-delimited so paths with spaces survive. Pure renames are skipped:
# the task.md cutover moves many existing verifier files and should not
# turn historical task-style debt into a repo-lint blocker.
git diff -z --name-only --diff-filter=ACM "${base}...HEAD" -- '*.py' \
> "$RUNNER_TEMP/changed_py.z"
echo "Changed Python files:"
tr '\0' '\n' < "$RUNNER_TEMP/changed_py.z" | sed 's/^/ /'
# xargs -r skips ruff entirely when no Python files changed.
xargs -0 -r uvx ruff@0.14.10 check < "$RUNNER_TEMP/changed_py.z"