Skip to content

ci: run the Windows suite only on PRs that change code - #536

Merged
blalterman merged 1 commit into
masterfrom
ci/windows-on-code-prs
Nov 5, 2026
Merged

blalterman merged 1 commit into
masterfrom
ci/windows-on-code-prs

Conversation

@blalterman

Copy link
Copy Markdown
Owner

Windows took about 5.5 minutes per PR against 3 to 4.7 for Linux. This runs the Windows suite only where it can catch something.

  • A new changes job diffs the PR against its base. test-windows runs only when a changed file is not documentation (docs/, paper/, .claude/, *.md, *.rst, CITATION.cff, LICENSE). An empty or unreadable diff runs Windows.
  • test-windows no longer runs on feature/** branch pushes; it runs on pull requests.
  • ci-summary accepts a skipped Windows job unless change detection itself failed.
  • The release matrix still tests Linux, macOS and Windows on Python 3.12 to 3.14 for every version tag.

The filter was checked locally under bash on eight sample change sets (docs only, root docs, source, docs plus a test, a workflow, pyproject.toml, CITATION.cff plus LICENSE, an empty diff). This PR changes a workflow file, so it counts as code and Windows runs here; the docs-only skip first runs on the next docs PR.

🤖 Generated with Claude Code

Windows took about 5.5 minutes per PR against 3 to 4.7 for Linux. A new
changes job diffs the PR against its base; test-windows runs only when a
changed file is not documentation (docs/, paper/, .claude/, *.md, *.rst,
CITATION.cff, LICENSE), and no longer runs on feature-branch pushes.
ci-summary accepts a skipped Windows job unless change detection failed.
The release matrix still tests Windows on every version tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@claude

claude Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Claude finished @blalterman's task in 17s —— View job


Review of PR #536

The change is small and the logic holds up. I read the diff and the workflow triggers but did not run the workflow. I found no blocking issues.

What works

  • The three-dot diff against base.sha with fetch-depth: 0 lists the files the PR changed. BASE_SHA goes in through env: rather than inline ${{ }}, so there is no shell-injection risk.
  • The filter fails safe. An empty diff gives grep -v no non-doc lines, and printf '%s\n' "" still emits one empty line. That line doesn't match the doc patterns, so code=true and Windows runs. A failed git diff leaves files empty and also gives code=true. A step that errors outright fails the changes job, and ci-summary rejects that.
  • ci-summary treats a skipped Windows job as success only when changes is neither failure nor cancelled. It still requires validate == success. The changes job is skipped on push events. Then test-windows is skipped too, and the summary passes it as intended.

Points to consider

  1. Doc-pattern anchoring. \.(md|rst)$ is unanchored at the start, so it matches .md or .rst files anywhere in the tree, including src/**/README.md and tests/data/*.md. That is fine for now. If a code path ever loads such a file at runtime, Windows would be skipped for a change that matters. If you want to be strict, drop the unanchored form and match only the root docs and docs/.
  2. .claude/ counts as docs. .claude/hooks/pre-commit-tests.sh and .claude/settings.json are not documentation, but nothing in the Windows suite exercises them except tests/test_hooks.py. That test is skipped on a .claude/-only PR. Linux still runs it, so Windows adds little there. This is acceptable.
  3. Required status checks. Check which checks branch protection requires. If test-windows is a required check, a skipped job reports as passing, so that is fine. If a required check name changed, update it. ci-summary is the safer one to require.
  4. feature/** push coverage. Windows no longer runs on branch pushes. A feature branch with no open PR gets no Windows signal until a PR is opened. The PR description states this, and it is a reasonable trade.
  5. Minor. The changes job costs a checkout with full history (fetch-depth: 0) on every PR. Depth is only needed for the three-dot merge-base. fetch-depth: 0 is correct, but a shallower fetch would need care. It is a few seconds, so leave it.
  6. Cosmetic. The ci-summary shell mixes ${{ }} interpolation and shell variables. It is safe because the values come from job results, not user input.

Tests and risks
There are no automated tests for workflow logic. The PR description says the filter was checked locally on eight sample change sets, which is adequate. The one thing left to confirm is the docs-only skip path. This PR changes a workflow, so it runs Windows, and the skip first fires on the next docs PR. Open a small docs-only PR soon to confirm that ci-summary passes when Windows is skipped.

Verdict: Looks good to merge. Point 1 is the one thing I'd tighten if you want the filter stricter.

@blalterman
blalterman merged commit ffce0fe into master Nov 5, 2026
15 checks passed
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