From ce6eeff91f9fd6d537a50b4392bbf4ed2d35691b Mon Sep 17 00:00:00 2001 From: Mikey Sklar Date: Fri, 23 Oct 2026 12:54:50 -0700 Subject: [PATCH] CI: split the Zephyr tests into more parallel jobs native_sim, native_sim_asan and native_sim_lfs each get their own job, so each job builds one firmware instead of three on 4 cores. Each bsim suite is split by the zephyr_sample marker, so the tests that build Zephyr samples, the slowest part of the suite, run in their own job. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/run-zephyr-tests.yml | 24 ++++++++++++++++++------ ports/zephyr-cp/Makefile | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-zephyr-tests.yml b/.github/workflows/run-zephyr-tests.yml index d9518c2d834..ebdd5daba21 100644 --- a/.github/workflows/run-zephyr-tests.yml +++ b/.github/workflows/run-zephyr-tests.yml @@ -13,19 +13,31 @@ jobs: name: ${{ matrix.shard }} strategy: fail-fast: ${{ github.event_name == 'merge_group' }} - # One job per board family, so the bsim suites, which take the longest, run - # side by side instead of after each other. + # One job per board, so each job builds one firmware. Each bsim suite is also split + # by the zephyr_sample marker, so the tests that build Zephyr samples get their own job. matrix: include: - shard: native_sim - boards: native_native_sim native_native_sim_asan native_native_sim_lfs - pytest_args: tests/ --ignore=tests/bsim -n $(nproc) --dist loadfile + boards: native_native_sim + pytest_args: tests/ --ignore=tests/bsim -k 'not native_native_sim_asan and not native_native_sim_lfs' -n $(nproc) --dist loadfile + - shard: native_sim_asan + boards: native_native_sim_asan + pytest_args: tests/ --ignore=tests/bsim -k native_native_sim_asan -n $(nproc) --dist loadfile + - shard: native_sim_lfs + boards: native_native_sim_lfs + pytest_args: tests/ --ignore=tests/bsim -k native_native_sim_lfs -n $(nproc) --dist loadfile - shard: nrf5340bsim boards: native_nrf5340bsim - pytest_args: tests/bsim -k native_nrf5340bsim -n $(nproc) --dist loadfile + pytest_args: tests/bsim -k native_nrf5340bsim -m 'not zephyr_sample' -n $(nproc) --dist loadfile + - shard: nrf5340bsim-samples + boards: native_nrf5340bsim + pytest_args: tests/bsim -k native_nrf5340bsim -m zephyr_sample -n $(nproc) --dist loadfile - shard: nrf54lm20bsim boards: native_nrf54lm20bsim - pytest_args: tests/bsim -k native_nrf54lm20bsim -n $(nproc) --dist loadfile + pytest_args: tests/bsim -k native_nrf54lm20bsim -m 'not zephyr_sample' -n $(nproc) --dist loadfile + - shard: nrf54lm20bsim-samples + boards: native_nrf54lm20bsim + pytest_args: tests/bsim -k native_nrf54lm20bsim -m zephyr_sample -n $(nproc) --dist loadfile env: CP_VERSION: ${{ inputs.cp-version }} steps: diff --git a/ports/zephyr-cp/Makefile b/ports/zephyr-cp/Makefile index adb1d658ee6..5d5554c4fbc 100644 --- a/ports/zephyr-cp/Makefile +++ b/ports/zephyr-cp/Makefile @@ -257,7 +257,7 @@ test-build-$(1): endef $(foreach board,$(TEST_BOARDS),$(eval $(call test_board_rule,$(board)))) -# CI runs this as three jobs, one per board family, narrowing TEST_BOARDS and +# CI splits this into several jobs, one board each, narrowing TEST_BOARDS and # PYTEST_ARGS; see .github/workflows/run-zephyr-tests.yml. PYTEST_ARGS ?= tests/