Skip to content

Commit 3b600ac

Browse files
committed
Potentially compute settings of fewer boards
.. when the file is within ports, just get the settings for boards within the port
1 parent ad130e8 commit 3b600ac

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

tools/ci_set_matrix.py

100644100755
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,19 @@ def set_boards_to_build(build_all):
9191
port_to_boards[port].add(board_id)
9292
board_to_port[board_id] = port
9393

94-
def compute_board_settings():
95-
if board_settings:
94+
def compute_board_settings(boards):
95+
need = set(boards) - set(board_settings.keys())
96+
if not need:
9697
return
9798

98-
def get_settings(arg):
99-
board = arg[1].name
99+
def get_settings(board):
100100
return (
101101
board,
102102
get_settings_from_makefile(str(top_dir / "ports" / board_to_port[board]), board),
103103
)
104104

105105
with ThreadPoolExecutor(max_workers=os.cpu_count()) as ex:
106-
board_settings.update(ex.map(get_settings, all_ports_all_boards()))
106+
board_settings.update(ex.map(get_settings, need))
107107

108108
boards_to_build = all_board_ids
109109

@@ -142,8 +142,13 @@ def get_settings(arg):
142142
# As a (nearly) last resort, for some certain files, we compute the settings from the
143143
# makefile for each board and determine whether to build them that way.
144144
if p.startswith("frozen") or p.startswith("supervisor") or module_matches:
145-
compute_board_settings()
146-
for board in all_board_ids:
145+
if port_matches:
146+
port = port_matches.group(1)
147+
board_ids = port_to_boards[port]
148+
else:
149+
board_ids = all_board_ids
150+
compute_board_settings(board_ids)
151+
for board in board_ids:
147152
settings = board_settings[board]
148153

149154
# Check frozen files to see if they are in each board.

0 commit comments

Comments
 (0)