Repository navigation
CI: skip the build on pull requests that change only documentation - #287
sombraSoft wants to merge 1 commit into
Conversation
A docs-only PR waits about half an hour for a Windows build whose result cannot differ from main's. A light `changes` job reads the PR's file list (the same API call PR checks makes) and the build job's `if:` skips it when every file is on a safe-to-skip list: docs/, top-level .md files, the PR / issue templates, pr-check.yml, LICENSE, .gitignore. Anything else, a push to main, or a list that cannot be read runs the build. The `on:` triggers stay as they are: a job skipped by its `if:` reports success to a required check, while a workflow skipped by a `paths` filter leaves it pending forever. The build's `if:` starts with !cancelled() so a failed `changes` job runs the build instead of skipping it (a job whose `needs` failed is otherwise skipped, which also reads as success). The `scripts` output is for a job that tests scripts/.
d59e084 to
2bbe1e4
Compare
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Nothing has happened on this PR for 3 days, so it is marked |
|
No open or merged PR skips the build for documentation-only pull requests; #286 (same author) only bumps action versions in ci.yml. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Pull requests that change only documentation skip the Windows build, and the required check still reports.
Part of #265
A light
changesjob reads the PR's file list (the same API callPR checksmakes). The build job'sif:skips the build when every file is safe to skip:docs/, top-level.md, the PR / issue templates,pr-check.yml,LICENSEand.gitignore. Any other file, a push tomain, or a list that cannot be read runs the build.The
on:triggers are unchanged. A job skipped by itsif:reports success to a required check (GitHub docs); a workflow-levelpathsfilter would leave it pending forever.What is in it
.github/workflows/ci.yml:changesjob (ubuntu,gh api …/pulls/N/files) with outputsrustandscripts. Each output defaults totrue. Renamed files count under both their old and new names.windowsjob getsneeds: changesandif: !cancelled() && needs.changes.outputs.rust != 'false', so a failedchangesjob runs the build instead of skipping it..mdfiles are skipped, becausecrates/xcl/data/stubdb.tomlandtests/data/are read by the code. Nothing readsdocs/.if:: clippy (CI: run clippy on all targets, warnings only #277) onrust, the script tests (CI: run scripts/test-native-stderr.tests.ps1 under PowerShell 5.1 and 7 #279) onscripts. cargo-deny (CI: check dependency licences, bans and sources with cargo-deny #276) would get adepsoutput.CI time
changesjob (Ubuntu). A docs-only PR skips the Windows build entirely (~1.5–2.5 min).Tested
ci.yml: https://github.com/sombraSoft/xcl/actions/runs/45278328881.Changed filesand the build both ran, green.docs/wave64-on-wave32.md: https://github.com/sombraSoft/xcl/actions/runs/45278397518.Changed fileswas green (rust=false), the build showed as skipped, and the run was green..md,scripts/,Cargo.lock, rename into docs, empty list, API failure and push.main(9ab7d76), RTX 3060 Ti (driver 621.24), Ryzen 9 5900X, Windows 11, rustc 1.97.1, debug:scripts/test.ps1→ 651 passed, 0 failed, 40 ignored; SKIPPED: 2 (no wave64). This PR changes only CI config, so the compiled code is the same.Regression run
crates/xcl/srcchange.Not tested
changesjob; that case is covered by the local API-failure test and the!cancelled()condition.AI use