Skip to content

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

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

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

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 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.

Diff

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

No other files changed. Workflow shape only.

Note on dorny/paths-filter

SHA pinned to de90cc6...c1b5 (v3.0.2). If detect-changes fails on first run, the SHA likely needs an update to current from the release page. Easy fix.

Test plan

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

  • Docs-only PR → dprint runs, all others 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 changed the base branch from main to ci/path-filters-fix July 19, 2026 03:26
@EVWorth EVWorth closed this Jul 19, 2026
@EVWorth
EVWorth deleted the ci/path-filters branch July 19, 2026 03:26
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