Skip to content

Commit ab4a6bf

Browse files
committed
ci_set_matrix: split a port into alphabetical runs, not interleaved
Each part covered the whole alphabet, so finding a board meant looking at every part. Slice the sorted list into consecutive runs instead.
1 parent 4d5fc4b commit ab4a6bf

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

tools/ci_set_matrix.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,17 +271,18 @@ def get_settings(board):
271271
print(" ", board)
272272

273273
# build-boards.yml runs one matrix per port and GitHub allows 256 jobs per matrix.
274-
# Split a bigger port into equal parts, listed like ports; "split_ports" maps a part
275-
# back to the real port name, which build.yml passes on, so the toolchain setup in
276-
# build-boards.yml stays unchanged.
274+
# Split a bigger port into alphabetical runs of equal size, listed like ports;
275+
# "split_ports" maps a part back to the real port name, which build.yml passes on, so
276+
# the toolchain setup in build-boards.yml stays unchanged.
277277
split_ports = {}
278278
for port, boards in list(port_to_boards_to_build.items()):
279279
parts = math.ceil(len(boards) / GITHUB_MATRIX_LIMIT)
280280
if parts > 1:
281281
del port_to_boards_to_build[port]
282-
for index in range(parts):
283-
name = f"{port}-{index + 1}"
284-
port_to_boards_to_build[name] = boards[index::parts]
282+
size = math.ceil(len(boards) / parts)
283+
for index, start in enumerate(range(0, len(boards), size), start=1):
284+
name = f"{port}-{index}"
285+
port_to_boards_to_build[name] = boards[start : start + size]
285286
split_ports[name] = port
286287

287288
if port_to_boards_to_build:

0 commit comments

Comments
 (0)