CI: skip the build on pull requests that change only documentation #287

Open
github-bot wants to merge 1 commit from github-bot/gh-287 into main AGit
Owner

@⁠sombraSoft on GitHub · 2026-11-23 22:23 UTC · original
sombraSoft:ci/path-filters → main · +60 −3 · 1 files · 1 commits · open

Pull requests that change only documentation skip the Windows build, and the required check still reports.

Part of #265

A light changes job reads the PR's file list (the same API call PR checks makes). The build job's if: skips the build when every file is safe to skip: docs/, top-level .md, the PR / issue templates, pr-check.yml, LICENSE and .gitignore. Any other file, a push to main, or a list that cannot be read runs the build.

The on: triggers are unchanged. A job skipped by its if: reports success to a required check (GitHub docs); a workflow-level paths filter would leave it pending forever.

What is in it

  • .github/workflows/ci.yml:
    • A new changes job (ubuntu, gh api …/pulls/N/files) with outputs rust and scripts. Each output defaults to true. Renamed files count under both their old and new names.
    • The windows job gets needs: changes and if: !cancelled() && needs.changes.outputs.rust != 'false', so a failed changes job runs the build instead of skipping it.
    • The header comment is updated.
  • Only top-level .md files are skipped, because crates/xcl/data/stubdb.toml and tests/data/ are read by the code. Nothing reads docs/.
  • The pending CI PRs plug in with the same if:: clippy (#277) on rust, the script tests (#279) on scripts. cargo-deny (#276) would get a deps output.

CI time

  • +5–7 s before the build starts, for the changes job (Ubuntu). A docs-only PR skips the Windows build entirely (~1.5–2.5 min).

Tested

  • Fork, a PR changing ci.yml: https://github.com/sombraSoft/xcl/actions/runs/45278328881. Changed files and the build both ran, green.
  • Fork, a PR changing only docs/wave64-on-wave32.md: https://github.com/sombraSoft/xcl/actions/runs/45278397518. Changed files was green (rust=false), the build showed as skipped, and the run was green.
  • The shell logic, run locally against these cases: docs only, mixed, nested .md, scripts/, Cargo.lock, rename into docs, empty list, API failure and push.
  • Full suite on 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

  • Not needed: no crates/xcl/src change.

Not tested

  • Upstream branch protection is not visible to me. The build job's name is unchanged, so its required check context is the same.
  • A real failure of the changes job; that case is covered by the local API-failure test and the !cancelled() condition.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change and this description; I read the diff.
**@⁠sombraSoft** on GitHub · 2026-11-23 22:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/287) `sombraSoft:ci/path-filters` → `main` · +60 −3 · 1 files · 1 commits · open Pull requests that change only documentation skip the Windows build, and the required check still reports. Part of #265 A light `changes` job reads the PR's file list (the same API call `PR checks` makes). The build job's `if:` skips the build when every file is safe to skip: `docs/`, top-level `.md`, the PR / issue templates, `pr-check.yml`, `LICENSE` and `.gitignore`. Any other file, a push to `main`, or a list that cannot be read runs the build. The `on:` triggers are unchanged. A job skipped by its `if:` reports success to a required check ([GitHub docs](https://docs.github.com/en/pull-requests/how-tos/merge-and-close-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks)); a workflow-level `paths` filter would leave it pending forever. **What is in it** - `.github/workflows/ci.yml`: - A new `changes` job (ubuntu, `gh api …/pulls/N/files`) with outputs `rust` and `scripts`. Each output defaults to `true`. Renamed files count under both their old and new names. - The `windows` job gets `needs: changes` and `if: !cancelled() && needs.changes.outputs.rust != 'false'`, so a failed `changes` job runs the build instead of skipping it. - The header comment is updated. - Only top-level `.md` files are skipped, because `crates/xcl/data/stubdb.toml` and `tests/data/` are read by the code. Nothing reads `docs/`. - The pending CI PRs plug in with the same `if:`: clippy (#277) on `rust`, the script tests (#279) on `scripts`. cargo-deny (#276) would get a `deps` output. **CI time** - +5–7 s before the build starts, for the `changes` job (Ubuntu). A docs-only PR skips the Windows build entirely (~1.5–2.5 min). **Tested** - Fork, a PR changing `ci.yml`: https://github.com/sombraSoft/xcl/actions/runs/45278328881. `Changed files` and the build both ran, green. - Fork, a PR changing only `docs/wave64-on-wave32.md`: https://github.com/sombraSoft/xcl/actions/runs/45278397518. `Changed files` was green (`rust=false`), the build showed as skipped, and the run was green. - The shell logic, run locally against these cases: docs only, mixed, nested `.md`, `scripts/`, `Cargo.lock`, rename into docs, empty list, API failure and push. - Full suite on `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** - Not needed: no `crates/xcl/src` change. **Not tested** - Upstream branch protection is not visible to me. The build job's name is unchanged, so its required check context is the same. - A real failure of the `changes` job; that case is covered by the local API-failure test and the `!cancelled()` condition. **AI use** - Claude Code (Claude Opus 5.5) wrote the change and this description; I read the diff.
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/.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:18:45 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 15:03 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 15:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/287#issuecomment-7166237256) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/287/head:github-bot/gh-287'
git switch 'github-bot/gh-287'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-287'
git switch 'github-bot/gh-287'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-287'
git switch 'github-bot/gh-287'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-287'
git switch 'main'
git merge --squash 'github-bot/gh-287'
git switch 'main'
git merge --ff-only 'github-bot/gh-287'
git switch 'main'
git merge 'github-bot/gh-287'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.