From da40be2f113bff7e8fa3d6616bbf2f6061d7739a Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Mon, 5 Jul 2021 23:24:07 -0400 Subject: [PATCH] util: fix CI vial compile --- util/ci_compile_vial_keyboards.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/util/ci_compile_vial_keyboards.py b/util/ci_compile_vial_keyboards.py index d47ea19776..a9432a231d 100755 --- a/util/ci_compile_vial_keyboards.py +++ b/util/ci_compile_vial_keyboards.py @@ -1,20 +1,29 @@ #!/usr/bin/env python3 from glob import glob +from collections import defaultdict import subprocess import sys def main(): + keymaps = defaultdict(set) + for filename in glob("keyboards/**/vial.json", recursive=True): filename = filename[10:-10] - cmd = filename.split("/keymaps/")[0] - # compile default - ret_default = subprocess.call(["make", cmd + ":default", "-j4"]) - # compile via - ret_via = subprocess.call(["make", cmd + ":via", "-j4"]) + keyboard, keymap = filename.split("/keymaps/") + keymaps[keyboard].add("default") + keymaps[keyboard].add(keymap) - if ret_default != 0 or ret_via != 0: - sys.exit(1) + failed = False + for keyboard, keymaps in keymaps.items(): + for keymap in keymaps: + sys.stdout.write("==> Compiling {}:{}\n".format(keyboard, keymap)) + sys.stdout.flush() + if subprocess.call(["make", "{}:{}".format(keyboard, keymap), "-j4"]) != 0: + failed = True + + if failed: + sys.exit(1) if __name__ == "__main__":