Skip to content

Commit 847d0a4

Browse files
realmarcinclaude
andauthored
Add validate-strict CI workflow (#89)
* Add validate-strict CI workflow Locks in the 0-error closed-schema baseline established across PRs #84-#88 so it can't silently regress on future merges. Mirrors the qc.yaml workflow shipped to TraitMech in PR #77 and adapted for the CommunityMech runner conventions. Runs `just validate-strict` + `just audit-writers` + `pytest tests/` on PRs touching kb/communities/, schema, source, scripts, justfile, or this workflow. Uploads the categorized TSV reports as workflow artifacts so reviewers can inspect failures without re-running locally. Deliberately scoped narrower than `just qc` — the existing network-quality.yml handles the network-integrity audit; this new workflow specifically gates closed-schema validation + writer audit + unit tests, which are fast and run on every PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Address Copilot review on PR #89 Three findings, all addressed: - Path globs: \`**.py\` doesn't actually match nested subdirs in GitHub Actions glob semantics — it behaves like \`*.py\`. Switch to \`**/*.py\` so changes under src/communitymech/<subpkg>/ (like network/, validators/, embedding/) trigger the workflow. - Push trigger had no \`paths:\` filter, so the workflow ran on every commit to main. Mirror the pull_request path list via a YAML anchor (&trigger_paths + *trigger_paths) so the two stay in sync. - uv sync: switch to \`--frozen --all-extras\` so the workflow fails if uv.lock is stale (instead of silently re-resolving) while keeping the dev/test extras the existing network-quality.yml uses. Also added uv.lock + tests/**/*.py to the trigger paths so dependency and test changes re-run the workflow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 393b373 commit 847d0a4

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: validate-strict
2+
3+
on:
4+
pull_request:
5+
paths: &trigger_paths
6+
- "kb/communities/**"
7+
- "src/communitymech/schema/**"
8+
- "src/communitymech/**/*.py"
9+
- "scripts/**/*.py"
10+
- "tests/**/*.py"
11+
- "justfile"
12+
- "pyproject.toml"
13+
- "uv.lock"
14+
- ".github/workflows/validate-strict.yaml"
15+
push:
16+
branches: [main]
17+
paths: *trigger_paths
18+
workflow_dispatch:
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
validate-strict:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: extractions/setup-just@v3
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.10"
35+
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v5
38+
with:
39+
version: "latest"
40+
enable-cache: true
41+
42+
- name: Install dependencies
43+
# --frozen fails the workflow if uv.lock is stale (don't silently
44+
# re-resolve in CI). --all-extras keeps parity with the existing
45+
# network-quality.yml workflow and ensures pytest + optional deps
46+
# are available for the test step below.
47+
run: uv sync --frozen --all-extras
48+
49+
- name: Run validate-strict (closed-schema LinkML validation)
50+
run: just validate-strict
51+
52+
- name: Run audit-writers
53+
run: just audit-writers
54+
55+
- name: Run tests
56+
run: uv run pytest tests/ -q --no-cov
57+
58+
- name: Upload reports
59+
if: always()
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: validate-strict-reports-${{ github.run_id }}
63+
path: |
64+
reports/instance_validation_failures.tsv
65+
reports/pipeline_writers_audit.tsv
66+
if-no-files-found: warn

0 commit comments

Comments
 (0)