Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
runs-on: ubuntu-24.04
outputs:
docs: ${{ steps.set-matrix.outputs.docs }}
zephyr-tests: ${{ steps.set-matrix.outputs.zephyr-tests }}
ports: ${{ steps.set-matrix.outputs.ports }}
cp-version: ${{ steps.set-up-submodules.outputs.version }}
steps:
Expand Down Expand Up @@ -102,6 +103,7 @@ jobs:

zephyr-tests:
needs: scheduler
if: needs.scheduler.outputs.zephyr-tests == 'True'
uses: ./.github/workflows/run-zephyr-tests.yml
with:
cp-version: ${{ needs.scheduler.outputs.cp-version }}
Expand Down
21 changes: 21 additions & 0 deletions tools/ci_set_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@

GITHUB_MATRIX_LIMIT = 256

# The Zephyr tests build native_sim and the two bsim boards out of the shared sources, so a
# change confined to these cannot reach them: another port, a translation, a frozen library
# (this port has none), documentation or the unix test suite.
PATTERN_ZEPHYR_TESTS_IGNORE = re.compile(r"^(?:docs|frozen|locale|tests)/|^ports/(?!zephyr-cp/)")

PATTERN_WINDOWS = {
".github/",
"extmod/",
Expand Down Expand Up @@ -321,6 +326,21 @@ def set_docs(run: bool):
set_output("docs", run)


def set_zephyr_tests(run: bool):
if not run:
if any(job.startswith("zephyr-tests") for job in last_failed_jobs):
run = True
else:
for file in changed_files:
if not PATTERN_ZEPHYR_TESTS_IGNORE.match(file):
run = True
break

# Set the step outputs
print("Running Zephyr tests:", run)
set_output("zephyr-tests", run)


def set_windows(run: bool):
if not run:
if last_failed_jobs.get("windows"):
Expand All @@ -347,6 +367,7 @@ def main():
print("Running: " + ("all" if run_all else "conditionally"))
# Set jobs
set_docs(run_all)
set_zephyr_tests(run_all)
set_windows(run_all)
set_boards(run_all)

Expand Down
Loading