Repository navigation
CI: skip the build on pull requests that change only documentation - #287
Open
sombraSoft wants to merge 1 commit into
Open
sombraSoft wants to merge 1 commit into
sombraSoft wants to merge 1 commit into
Conversation
8 tasks
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/.
sombraSoft
force-pushed
the
ci/path-filters
branch
from
November 23, 2026 23:12
d59e084 to
2bbe1e4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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