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

Closed
sombraSoft wants to merge 1 commit from upstream-pr/287 into main
sombraSoft commented 2026-11-23 22:23:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by sombraSoft on 2026-11-23T22:23:20Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:5462260285 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/287). Originally posted by [sombraSoft](https://github.com/sombraSoft) on 2026-11-23T22:23:20Z. --- 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.
DavidM1911 commented 2026-11-25 15:08:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T15:03:32Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7166237256 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/287#issuecomment-7166237256). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T15:03:32Z. --- 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!
github-actions[bot] commented 2026-11-29 20:42:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:42:30Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7262294420 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/287#issuecomment-7262294420). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T20:42:30Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 03:04:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:04:37Z.


Triage (#1607) – head 2bbe1e4

No open or merged PR skips the build for documentation-only pull requests; #286 (same author) only bumps action versions in ci.yml.
No problems found in the diff: unknown files, pushes, an unreadable file list and a failed changes job all still run the build (!cancelled() and the != 'false' test). The scripts output is not used by any job in this PR yet (it is meant for #279).
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7299296422 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/287#issuecomment-7299296422). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:04:37Z. --- **Triage (#1607)** – head 2bbe1e4 No open or merged PR skips the build for documentation-only pull requests; #286 (same author) only bumps action versions in ci.yml. No problems found in the diff: unknown files, pushes, an unreadable file list and a failed `changes` job all still run the build (`!cancelled()` and the `!= 'false'` test). The `scripts` output is not used by any job in this PR yet (it is meant for #279). Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!284
No description provided.