Skip to content

CI: skip tests and mpy-cross jobs when changes can't affect them - #11916

Merged
tannewt merged 8 commits into
adafruit:mainfrom
dhalbert:ci-skip-unneeded-jobs
Nov 19, 2026
Merged

tannewt merged 8 commits into
adafruit:mainfrom
dhalbert:ci-skip-unneeded-jobs

Conversation

@dhalbert

@dhalbert dhalbert commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Code by Claude, reviewed by @dhalbert.

I noticed that simple board changes were re-running a lot of unneeded jobs, so I had Claude change the CI so only necessary jobs were re-run.

Problem

  • The tests job (the unix coverage tests) ran on every commit, even when only another port's files changed.
  • The mpy-cross and mpy-cross-mac jobs ran whenever any board was built. The board builds don't use them: they use the mpy-cross that the scheduler job builds.

Fix

  • tools/ci_set_matrix.py now sets tests and mpy-cross outputs, and build.yml gates the jobs on them. A job is skipped only when every changed file matches its ignore list:
    • tests: docs/, or any port except ports/unix/.
    • mpy-cross and mpy-cross-mac: docs/, frozen/, ports/ or tests/.
  • mpy-cross still always builds on push, so every version's binaries are still uploaded to S3.
  • The ports job needs tests, and a skipped tests would skip it too. Its if: now includes !failure() && !cancelled().

Unrelated to this PR but a leftover:

  • Removed code left over from the Windows builds, which were removed in 3d73831: set_windows() in tools/ci_set_matrix.py, and the windows and windows-zephyr targets in tools/ci_fetch_deps.py.

Testing

Test commits in this PR, reverted in the last commit, each changed one file to check which jobs run. Each ran only the expected jobs:

  • a Pico board file
  • ports/unix/Makefile
  • tests/basics/int1.py
  • an nRF54L15 DK board file
  • docs/index.rst

dhalbert and others added 8 commits November 19, 2026 08:23
The tests job ran on every commit, and mpy-cross and mpy-cross-mac ran
whenever any board was built, even though the board builds use the
mpy-cross built by the scheduler.

ci_set_matrix.py now sets tests and mpy-cross outputs. Each job is
skipped only when every changed file matches its ignore list. mpy-cross
still always builds on push, so each version's binaries reach S3. The
ports job needs tests, so its if: now allows a skipped tests job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Windows builds were removed in 3d73831. Remove set_windows() and
PATTERN_WINDOWS from ci_set_matrix.py, which set an output nothing
reads, and the unused windows and windows-zephyr targets from
ci_fetch_deps.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove the one-line test changes used to check which CI jobs run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhalbert
dhalbert marked this pull request as ready for review November 19, 2026 15:26

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt
tannewt merged commit 4afca0b into adafruit:main Nov 19, 2026
10 checks passed
@dhalbert
dhalbert deleted the ci-skip-unneeded-jobs branch November 19, 2026 17:34
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.

2 participants