Skip to content

CI: run the full matrix only when a pull request needs it - #641

Merged
mmschlk merged 3 commits into
mainfrom
claude/upbeat-edison-e9x3bi
Oct 24, 2026
Merged

mmschlk merged 3 commits into
mainfrom
claude/upbeat-edison-e9x3bi

Conversation

@mmschlk

@mmschlk mmschlk commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Motivation and Context

Every push to a pull request ran all 15 CI jobs, no matter what changed: about 48 runner-minutes and 21 minutes of waiting, with the macOS tests alone taking about 16 minutes (example run on a docs-only PR). With coding agents pushing often, this fills the runner queue: the last 100 CI runs came within 11 days, one PR ran CI 14 times, and three docs-only PRs ran the full suite 7 times between them.

What a pull request now runs:

The PR changes Jobs Cost per push
only docs/, examples/, Markdown, .claude/, issue templates, RTD config code-quality checks ~1 min
Python code code-quality checks + Ubuntu jobs (stable tests with coverage, games, benchmark) ~12 runner-min, ~9 min of waiting
setup.py, pyproject.toml, uv.lock, MANIFEST.in, build_tools/, C++ extensions (/cext/), the CI workflows also the matrix (Windows, macOS, Python 3.14/3.15) as before
has the label full ci everything as before

Pushes to main and manual runs from the Actions tab still run everything.

Changes in .github/workflows/ci.yml:

  • A new job, "Detect changes", diffs the PR's merge commit against its base and sets which jobs run. It lists a moved file under both its old and new path, so moving a file out of src/ still runs the tests.
  • The coverage job ran the same tests on the same Python as the stable job. The stable job now measures and uploads coverage itself, and the separate coverage job is gone.
  • The install-and-import check runs only on Ubuntu, since the test matrix already installs shapiq on the other platforms.
  • Every job has a timeout-minutes (the default was 6 hours).
  • A new job, "CI result", fails if any job failed or was cancelled, and counts skipped jobs as passed.
  • A new push still cancels a pull request's running CI, but pushes to main no longer cancel each other. Every commit on main gets its own full run, since main is now where pure-Python changes first run on Windows, macOS and the newer Pythons.

New .github/workflows/ci_full.yml: adding the label full ci starts a full run right away. While the label is on, every later push runs the full CI too. It is a separate workflow on purpose: if ci.yml itself listened to labeled, adding any other label would start a run whose skipped jobs would replace the results of the last run on the same commit.

Branch protection: some job names changed ("Run Test Coverage" is gone; the install check and the stable tests were renamed). If any of the old names are required checks, require "CI result" instead.

Trade-off: a full run now waits about 3.5 minutes longer before the matrix starts, because the stable job also measures coverage. A Windows- or macOS-only break in pure-Python code would show up on main after merge rather than on the PR.


Public API Changes

  • No Public API changes
  • Yes, Public API changes (Details below)

How Has This Been Tested?

  • actionlint (with shellcheck) and pre-commit pass on both workflow files.
  • I ran the "Detect changes" script, with the regexes as parsed from the YAML, on the last 49 commits on main. 12 would have run only the code-quality checks (every "Docs:" commit and the README/CHANGELOG edits), 21 the Ubuntu jobs, and 16 the full matrix (C++ extensions, pyproject.toml/uv.lock, workflows). I also checked the push, manual-run, label and empty-diff cases, and a file moved from src/ to docs/.
  • On this PR, both the "CI Tests" run and the "Full CI" run started by adding the label passed. Each took the full-matrix path: the first because the PR changes ci.yml, the second because of the label.

Checklist

  • The changes have been tested locally.
  • Documentation has been updated (if the public API or usage changes).
  • An entry has been added to CHANGELOG.md (if relevant for users).
  • The code follows the project's style guidelines.
  • I have considered the impact of these changes on the public API.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MhQWPdeTbJyESb8uBYqLAU

Every push to a pull request ran all 15 jobs (~48 runner-minutes, ~21
minutes, the macOS tests alone ~16), whatever the push changed.

- A new job "Detect changes" reads the files a pull request changes.
  Documentation, examples and Markdown only: code-quality checks only.
  Python code: code-quality checks and the Ubuntu jobs (stable tests,
  games, benchmark). The build, the dependencies, the C++ extensions or
  the CI workflows: also the matrix (Windows, macOS, Python 3.14/3.15).
  Pushes to main and manual runs always run everything.
- The label "full ci" runs the matrix on a pull request: adding it starts
  a run (ci_full.yml), and while it is on, every push runs the matrix.
- The coverage job ran the same tests as the stable job on the same
  Python: the stable job now measures and uploads the coverage.
- The install-and-import check runs on Ubuntu only: the test matrix
  installs shapiq on the other platforms.
- Every job gets a timeout instead of the default six hours.
- A job "CI result" fails if any job failed or was cancelled, and a
  skipped job counts as passed: require it in branch protection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MhQWPdeTbJyESb8uBYqLAU
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mmschlk mmschlk added the full ci Run the full CI pipeline. label Oct 23, 2026
- "Detect changes" diffs without rename detection: a file moved from
  src/ to docs/ or examples/ listed only its new path, so the pull
  request counted as documentation only and skipped the tests.
- Pushes to main no longer cancel the run of the previous commit. Main
  is where pure-Python changes first meet Windows, macOS and the newer
  Pythons, and a cancelled run left its commit untested and with a
  failed "CI result".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MhQWPdeTbJyESb8uBYqLAU
@mmschlk
mmschlk merged commit 51bfe90 into main Oct 24, 2026
14 checks passed
@mmschlk
mmschlk deleted the claude/upbeat-edison-e9x3bi branch October 24, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full ci Run the full CI pipeline.

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants