util: fix CI vial compile

This commit is contained in:
Ilya Zhuravlev 2021-07-05 23:24:07 -04:00
parent a8097046f5
commit da40be2f11

View File

@ -1,20 +1,29 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from glob import glob from glob import glob
from collections import defaultdict
import subprocess import subprocess
import sys import sys
def main(): def main():
keymaps = defaultdict(set)
for filename in glob("keyboards/**/vial.json", recursive=True): for filename in glob("keyboards/**/vial.json", recursive=True):
filename = filename[10:-10] filename = filename[10:-10]
cmd = filename.split("/keymaps/")[0] keyboard, keymap = filename.split("/keymaps/")
# compile default keymaps[keyboard].add("default")
ret_default = subprocess.call(["make", cmd + ":default", "-j4"]) keymaps[keyboard].add(keymap)
# compile via
ret_via = subprocess.call(["make", cmd + ":via", "-j4"])
if ret_default != 0 or ret_via != 0: failed = False
sys.exit(1) 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__": if __name__ == "__main__":