Skip to content

Commit 51cea55

Browse files
committed
Added workaround for not building ALL
1 parent 3636f97 commit 51cea55

File tree

1 file changed

+44
-42
lines changed

1 file changed

+44
-42
lines changed

scripts/recursive_build.py

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -511,50 +511,52 @@ def query_database(changes_dict):
511511
changes_dict['mcu_list'].extend([device for device in set(new_mcu_list) if device not in changes_dict['mcu_list']])
512512
changes_dict['mcu_list'][:] = sorted(changes_dict['mcu_list'])
513513

514-
# If all lists for building are empty this means that either changes were made to Case 4 folders
515-
# or we are running build for everything.
516-
# In this case get all the SDK supported boards, MCU cards and MCUs from the database.
517-
if not changes_dict['mcu_list'] and not changes_dict['board_list'] and not changes_dict['mcu_card_list']:
518-
cursor.execute(f"""
519-
SELECT SDKToDevice.device_uid
520-
FROM SDKToDevice
521-
INNER JOIN Devices ON SDKToDevice.device_uid = Devices.uid
522-
WHERE SDKToDevice.sdk_uid = 'mikrosdk_v{sdk_version}'
523-
AND Devices.sdk_support = '1'
524-
AND SDKToDevice.device_uid NOT LIKE '%\\_%' ESCAPE '\\';
525-
""")
526-
rows = cursor.fetchall()
527-
if rows:
528-
new_mcu_list.extend([row[0] for row in rows])
529-
else:
530-
changes_dict['unused'].append(regex)
531-
changes_dict['mcu_list'].extend([device for device in set(new_mcu_list) if device not in changes_dict['mcu_list']])
532-
changes_dict['mcu_list'][:] = sorted(changes_dict['mcu_list'])
514+
# Workaround for not triggering the build for ALL as github has a 6 hours limitation for the Action.
515+
if os.getenv('BUILD_ALL') == '1':
516+
# If all lists for building are empty this means that either changes were made to Case 4 folders
517+
# or we are running build for everything.
518+
# In this case get all the SDK supported boards, MCU cards and MCUs from the database.
519+
if not changes_dict['mcu_list'] and not changes_dict['board_list'] and not changes_dict['mcu_card_list']:
520+
cursor.execute(f"""
521+
SELECT SDKToDevice.device_uid
522+
FROM SDKToDevice
523+
INNER JOIN Devices ON SDKToDevice.device_uid = Devices.uid
524+
WHERE SDKToDevice.sdk_uid = 'mikrosdk_v{sdk_version}'
525+
AND Devices.sdk_support = '1'
526+
AND SDKToDevice.device_uid NOT LIKE '%\\_%' ESCAPE '\\';
527+
""")
528+
rows = cursor.fetchall()
529+
if rows:
530+
new_mcu_list.extend([row[0] for row in rows])
531+
else:
532+
changes_dict['unused'].append(regex)
533+
changes_dict['mcu_list'].extend([device for device in set(new_mcu_list) if device not in changes_dict['mcu_list']])
534+
changes_dict['mcu_list'][:] = sorted(changes_dict['mcu_list'])
533535

534-
cursor.execute(f"""
535-
SELECT device_uid
536-
FROM SDKToDevice
537-
WHERE sdk_uid = 'mikrosdk_v{sdk_version}'
538-
AND device_uid REGEXP '_';
539-
""")
540-
rows = cursor.fetchall()
541-
if rows:
542-
new_mcu_card_list.extend([row[0] for row in rows])
543-
else:
544-
changes_dict['unused'].append(mcu_card)
545-
changes_dict['mcu_card_list'][:] = sorted(list(set(new_mcu_card_list)))
536+
cursor.execute(f"""
537+
SELECT device_uid
538+
FROM SDKToDevice
539+
WHERE sdk_uid = 'mikrosdk_v{sdk_version}'
540+
AND device_uid REGEXP '_';
541+
""")
542+
rows = cursor.fetchall()
543+
if rows:
544+
new_mcu_card_list.extend([row[0] for row in rows])
545+
else:
546+
changes_dict['unused'].append(mcu_card)
547+
changes_dict['mcu_card_list'][:] = sorted(list(set(new_mcu_card_list)))
546548

547-
cursor.execute(f"""
548-
SELECT board_uid
549-
FROM SDKToBoard
550-
WHERE sdk_uid = 'mikrosdk_v{sdk_version}';
551-
""")
552-
rows = cursor.fetchall()
553-
if rows:
554-
new_board_list.extend([row[0] for row in rows])
555-
else:
556-
changes_dict['unused'].append(board)
557-
changes_dict['board_list'][:] = sorted(list(set(new_board_list)))
549+
cursor.execute(f"""
550+
SELECT board_uid
551+
FROM SDKToBoard
552+
WHERE sdk_uid = 'mikrosdk_v{sdk_version}';
553+
""")
554+
rows = cursor.fetchall()
555+
if rows:
556+
new_board_list.extend([row[0] for row in rows])
557+
else:
558+
changes_dict['unused'].append(board)
559+
changes_dict['board_list'][:] = sorted(list(set(new_board_list)))
558560

559561
conn.close()
560562

0 commit comments

Comments
 (0)