Skip to content

Commit 161f9b7

Browse files
committed
ci_set_matrix: build the matrix output explicitly
"ports" was derived from the keys of the dict that "split_ports" was then inserted into, so the two lines only worked in that order. Build the output from the matrix entries in one place instead. "split_ports" stays in the output even when empty, because build.yml indexes it.
1 parent 4d5fc4b commit 161f9b7

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

tools/ci_set_matrix.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,18 @@ def get_settings(board):
284284
port_to_boards_to_build[name] = boards[index::parts]
285285
split_ports[name] = port
286286

287+
# The matrix entries plus what build.yml needs to drive them. "split_ports" is always
288+
# present, empty when nothing was split, because build.yml indexes it.
289+
output = {}
287290
if port_to_boards_to_build:
288-
port_to_boards_to_build["ports"] = sorted(list(port_to_boards_to_build.keys()))
289-
port_to_boards_to_build["split_ports"] = split_ports
291+
output = {
292+
**port_to_boards_to_build,
293+
"ports": sorted(port_to_boards_to_build),
294+
"split_ports": split_ports,
295+
}
290296

291297
# Set the step outputs
292-
set_output("ports", json.dumps(port_to_boards_to_build))
298+
set_output("ports", json.dumps(output))
293299

294300

295301
def set_docs(run: bool):

0 commit comments

Comments
 (0)