File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 runs-on : ubuntu-24.04
2323 outputs :
2424 docs : ${{ steps.set-matrix.outputs.docs }}
25+ zephyr-tests : ${{ steps.set-matrix.outputs.zephyr-tests }}
2526 ports : ${{ steps.set-matrix.outputs.ports }}
2627 cp-version : ${{ steps.set-up-submodules.outputs.version }}
2728 steps :
@@ -102,6 +103,7 @@ jobs:
102103
103104 zephyr-tests :
104105 needs : scheduler
106+ if : needs.scheduler.outputs.zephyr-tests == 'True'
105107 uses : ./.github/workflows/run-zephyr-tests.yml
106108 with :
107109 cp-version : ${{ needs.scheduler.outputs.cp-version }}
Original file line number Diff line number Diff line change 7171
7272GITHUB_MATRIX_LIMIT = 256
7373
74+ # The Zephyr tests build native_sim and the two bsim boards out of the shared sources, so a
75+ # change confined to these cannot reach them: another port, a translation, a frozen library
76+ # (this port has none), documentation or the unix test suite.
77+ PATTERN_ZEPHYR_TESTS_IGNORE = re .compile (r"^(?:docs|frozen|locale|tests)/|^ports/(?!zephyr-cp/)" )
78+
7479PATTERN_WINDOWS = {
7580 ".github/" ,
7681 "extmod/" ,
@@ -321,6 +326,21 @@ def set_docs(run: bool):
321326 set_output ("docs" , run )
322327
323328
329+ def set_zephyr_tests (run : bool ):
330+ if not run :
331+ if any (job .startswith ("zephyr-tests" ) for job in last_failed_jobs ):
332+ run = True
333+ else :
334+ for file in changed_files :
335+ if not PATTERN_ZEPHYR_TESTS_IGNORE .match (file ):
336+ run = True
337+ break
338+
339+ # Set the step outputs
340+ print ("Running Zephyr tests:" , run )
341+ set_output ("zephyr-tests" , run )
342+
343+
324344def set_windows (run : bool ):
325345 if not run :
326346 if last_failed_jobs .get ("windows" ):
@@ -347,6 +367,7 @@ def main():
347367 print ("Running: " + ("all" if run_all else "conditionally" ))
348368 # Set jobs
349369 set_docs (run_all )
370+ set_zephyr_tests (run_all )
350371 set_windows (run_all )
351372 set_boards (run_all )
352373
You can’t perform that action at this time.
0 commit comments