Skip to content

Commit

Permalink
Workflow testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarc committed Nov 26, 2024
1 parent 992f6d8 commit 7029a8b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions util/ci/pull_request_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def _get_all_keyboards_and_keymaps():
try:
oldcwd = os.getcwd()
os.chdir(os.environ["QMK_HOME"])

oldlevel = qmk_cli_loader.set_log_level(logging.ERROR)
all_targets = search_keymap_targets([("all", "all")])
except Exception as exc:
Expand Down Expand Up @@ -50,6 +49,7 @@ def _get_all_keyboards_and_keymaps():
qmk_cli_loader.import_qmk_cli(base_path)

# Get all keyboards and keymaps for the base repo
print("Getting all keyboards and keymaps")
(_, kb_km_base, exc) = _get_all_keyboards_and_keymaps()

# Unload the QMK CLI
Expand All @@ -67,6 +67,7 @@ def _get_all_keyboards_and_keymaps():
qmk_cli_loader.import_qmk_cli(target_path)

# Get all keyboards and keymaps for the target repo
print("Getting all keyboards and keymaps")
(_, kb_km_target, exc) = _get_all_keyboards_and_keymaps()

# Unload the QMK CLI
Expand All @@ -77,10 +78,17 @@ def _get_all_keyboards_and_keymaps():
if exc is not None:
raise exc

# Find the symmetric difference between the base and target keymap sets
diff = kb_km_base.symmetric_difference(kb_km_target)
# Find the combinations that exist in the target but not the base (we don't care if things are deleted)
removed = kb_km_base - kb_km_target
added = kb_km_target - kb_km_base

# Print out all the resulting keyboards and keymaps
print("Build targets:")
for (kb, km) in diff:
print(f" {kb}:{km}")
if len(added) > 0:
print("Build targets added:")
for (kb, km) in added:
print(f" {kb}:{km}")

if len(removed) > 0:
print("Build targets removed:")
for (kb, km) in removed:
print(f" {kb}:{km}")

0 comments on commit 7029a8b

Please sign in to comment.