Skip to content

ci: skip heavy jobs when only docs/workflows/config change - #199

Closed
EVWorth wants to merge 1 commit into
mainfrom
ci/path-filters-fix
Closed

EVWorth wants to merge 1 commit into
mainfrom
ci/path-filters-fix

Conversation

@EVWorth

@EVWorth EVWorth commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

Doc-only PRs (the bulk of recent work) no longer run the full Rust/Node test suites. They run only:

  • detect-changes (~5s)
  • dprint format check (~30s)

Saves ~5 minutes of CI time per docs PR.

How

  1. New detect-changes job uses dorny/paths-filter (v3.0.2, SHA-pinned) to classify changed files into 6 buckets:

    • frontend (src/, package.json, vitest/eslint configs)
    • rust (src-tauri/, Cargo.toml/lock)
    • npm (package.json/lock)
    • cargo (src-tauri/Cargo.toml/lock)
    • docs (docs/, README.md, .opencode/AGENTS.md)
    • workflows (.github/workflows/)
    • config (lefthook, dprint, vitest, opencode configs)
  2. Each existing job now has needs: detect-changes + if: condition gating on the relevant bucket(s).

  3. New dprint job runs on any docs/frontend change — catches formatting that lefthook might miss (e.g., PRs opened via GitHub UI).

Job → Bucket mapping

Job Trigger bucket(s) Doc-only runs?
npm-audit npm ❌
cargo-audit cargo ❌
check-versions cargo, npm ❌
deps-age npm ❌
lint-ts frontend ❌
lint-rust rust ❌
test-rust rust ❌
test-frontend frontend ❌
dprint (NEW) docs, frontend ✅
detect-changes (always runs) ✅
test-e2e if: false (disabled) ❌

Doc-only PRs run: detect-changes + dprint ≈ 35 seconds.
Code-touching PRs run: same as before, full suite.

dorny/paths-filter SHA fix

A previous attempt at this PR (#197) had an incorrect SHA pin (de90cc6fb38fc0963ad72b170f54eec651c5e9c9c4e9b2736dbd1b51d3c0c1b5 — wrong trailing chars). This PR uses the verified correct v3.0.2 SHA: d1c1ffe0248fe513906c8e24db8ea791d46f8590.

Diff

.github/workflows/ci.yml | 136 +++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 133 insertions(+), 3 deletions(-)

No other files changed. Workflow shape only.

Test plan

After merge, verify by opening PRs against different path sets:

  • Docs-only PR → dprint runs, all heavy jobs skipped
  • src/** change → lint-ts, test-frontend, dprint run
  • src-tauri/** change → lint-rust, test-rust run
  • package.json change → npm-audit, deps-age, lint-ts, test-frontend run

Related

Adds path-based job filtering. Doc-only PRs (the bulk of recent work)
no longer run the full Rust test suite (~5min), Node test suite
(~1.5min), Rust clippy (~3min), or TS lint (~30s). They run only:
- dprint format check (~30s)
- version consistency check (skipped unless manifests change)
- the detect-changes job itself (~5s)

How it works:
1. New detect-changes job uses dorny/paths-filter to classify changed
   files into 6 buckets: frontend, rust, npm, cargo, docs, workflows,
   config
2. Each downstream job has 'needs: detect-changes' + 'if' condition
   based on which buckets changed
3. Doc-only PRs: only dprint runs (plus detect-changes itself)

Job-by-job mapping:

  frontend → lint-ts, test-frontend
  rust     → lint-rust, test-rust
  npm      → npm-audit, deps-age
  cargo    → cargo-audit, check-versions (when Cargo.toml/lock changed)
  docs     → dprint
  workflows → (none — workflow changes always trigger detect-changes)
  config   → (none — config files covered by their owning bucket)

New dprint job:
- Catches formatting issues that lefthook might miss
  (e.g., PRs opened via GitHub UI without local pre-commit)
- Runs on any doc or frontend change

test-e2e stays disabled (if: false) per existing config.

Note: dorny/paths-filter SHA pinned to v3.0.2. SHA may need verification
on first run; if workflow errors on detect-changes, update to current
SHA from https://github.com/dorny/paths-filter/releases.
@EVWorth EVWorth closed this Jul 19, 2026
@EVWorth
EVWorth deleted the ci/path-filters-fix branch July 19, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant