From 353e0db2632d1e9d70fc4cb531701a7a8921a758 Mon Sep 17 00:00:00 2001 From: Mikey Sklar Date: Wed, 2 Sep 2026 11:01:01 -0700 Subject: [PATCH 1/2] Run Zephyr tests in their own workflow The `ports` job depends on `tests`, and `tests` is the whole of run-tests.yml, which contained both the VM test matrix and the Zephyr job. A called workflow is not complete until every job in it is, so no board in any port started building until the Zephyr job had finished its west setup, built native_sim and bsim, and run the port's tests. That happened on every pull request, including ones touching no Zephyr code. Move the Zephyr job into run-zephyr-tests.yml and call it from build.yml alongside `tests`, but deliberately not in `ports`' `needs`. The job body is byte-identical and still runs on every pull request. Two consequences worth naming, since the job body being unchanged does not make them so: The check run is now named `zephyr-tests / zephyr` rather than `tests / zephyr`. Branch protection lists required checks by name, so it needs updating if it names the old one. That rename also changes ci_changes_per_commit.py, which prefix-matches check names against have_dependent_jobs = ["scheduler", "mpy-cross", "tests"]. A failed Zephyr job used to match and disable the resume-from- last-checked-commit optimization entirely. It no longer matches, and the result is discarded, which is correct now that nothing depends on it. It is deliberately not added to that list. Also add the new workflow to IGNORE_BOARD in ci_set_matrix.py, next to run-tests.yml. Without it, editing the file falls through to the "build it all" case and rebuilds every board in the repo. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/build.yml | 8 +++++ .github/workflows/run-tests.yml | 38 --------------------- .github/workflows/run-zephyr-tests.yml | 47 ++++++++++++++++++++++++++ tools/ci_set_matrix.py | 1 + 4 files changed, 56 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/run-zephyr-tests.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47b19a8fa7b..1931560d78d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,6 +100,12 @@ jobs: with: cp-version: ${{ needs.scheduler.outputs.cp-version }} + zephyr-tests: + needs: scheduler + uses: ./.github/workflows/run-zephyr-tests.yml + with: + cp-version: ${{ needs.scheduler.outputs.cp-version }} + mpy-cross: needs: scheduler if: needs.scheduler.outputs.ports != '{}' @@ -214,6 +220,8 @@ jobs: [ -z "$TWINE_USERNAME" ] || twine upload circuitpython-stubs/dist/* ports: + # zephyr-tests is deliberately absent: nothing built here depends on it, and + # waiting on it delayed every port's boards on every pull request. needs: [scheduler, mpy-cross, tests] if: needs.scheduler.outputs.ports != '{}' uses: ./.github/workflows/build-boards.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 711b5f321b6..20e4a8e8298 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -65,41 +65,3 @@ jobs: if: matrix.test == 'all' run: ./run-natmodtests.py extmod/{heapq*,random*,re*}.py working-directory: tests - - zephyr: - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - env: - CP_VERSION: ${{ inputs.cp-version }} - steps: - - name: Set up repository - uses: actions/checkout@v6 - with: - submodules: false - show-progress: false - fetch-depth: 1 - - name: Set up python - uses: actions/setup-python@v6 - with: - python-version: 3.13 - - name: Set up Zephyr - uses: ./.github/actions/deps/ports/zephyr-cp - - name: Set up submodules - id: set-up-submodules - uses: ./.github/actions/deps/submodules - with: - target: zephyr-cp - - name: Set up external - uses: ./.github/actions/deps/external - - name: Build native sim target - run: make -C ports/zephyr-cp -j2 BOARD=native_native_sim - - name: Build bsim - run: make -j 2 everything - working-directory: ports/zephyr-cp/tools/bsim - - name: Build native_nrf5340bsim - run: make -C ports/zephyr-cp -j2 BOARD=native_nrf5340bsim - - name: Build native_nrf54lm20bsim - run: make -C ports/zephyr-cp -j2 BOARD=native_nrf54lm20bsim - - name: Run Zephyr tests - run: make -C ports/zephyr-cp test diff --git a/.github/workflows/run-zephyr-tests.yml b/.github/workflows/run-zephyr-tests.yml new file mode 100644 index 00000000000..50e5174a3eb --- /dev/null +++ b/.github/workflows/run-zephyr-tests.yml @@ -0,0 +1,47 @@ +name: Run Zephyr tests + +on: + workflow_call: + inputs: + cp-version: + required: true + type: string + +jobs: + zephyr: + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + env: + CP_VERSION: ${{ inputs.cp-version }} + steps: + - name: Set up repository + uses: actions/checkout@v6 + with: + submodules: false + show-progress: false + fetch-depth: 1 + - name: Set up python + uses: actions/setup-python@v6 + with: + python-version: 3.13 + - name: Set up Zephyr + uses: ./.github/actions/deps/ports/zephyr-cp + - name: Set up submodules + id: set-up-submodules + uses: ./.github/actions/deps/submodules + with: + target: zephyr-cp + - name: Set up external + uses: ./.github/actions/deps/external + - name: Build native sim target + run: make -C ports/zephyr-cp -j2 BOARD=native_native_sim + - name: Build bsim + run: make -j 2 everything + working-directory: ports/zephyr-cp/tools/bsim + - name: Build native_nrf5340bsim + run: make -C ports/zephyr-cp -j2 BOARD=native_nrf5340bsim + - name: Build native_nrf54lm20bsim + run: make -C ports/zephyr-cp -j2 BOARD=native_nrf54lm20bsim + - name: Run Zephyr tests + run: make -C ports/zephyr-cp test diff --git a/tools/ci_set_matrix.py b/tools/ci_set_matrix.py index cdad0e6d3b6..9204a963055 100755 --- a/tools/ci_set_matrix.py +++ b/tools/ci_set_matrix.py @@ -51,6 +51,7 @@ "tools/ci_check_duplicate_usb_vid_pid.py", "tools/ci_set_matrix.py", ".github/workflows/run-tests.yml", + ".github/workflows/run-zephyr-tests.yml", ".github/workflows/build-board-custom.yml", ".github/workflows/bundle_cron.yml", ".github/workflows/create-website-pr.yml", From a501fb46372415758e417e9e7dc6f4abf052c9ea Mon Sep 17 00:00:00 2001 From: Mikey Sklar Date: Wed, 2 Sep 2026 11:45:22 -0700 Subject: [PATCH 2/2] Drop the inline comment on ports' needs Per review: the reason belongs in git history, not an inline comment. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1931560d78d..4076fd2d68d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -220,8 +220,6 @@ jobs: [ -z "$TWINE_USERNAME" ] || twine upload circuitpython-stubs/dist/* ports: - # zephyr-tests is deliberately absent: nothing built here depends on it, and - # waiting on it delayed every port's boards on every pull request. needs: [scheduler, mpy-cross, tests] if: needs.scheduler.outputs.ports != '{}' uses: ./.github/workflows/build-boards.yml