From 63964d2ff7f0490205f255f8b32e807d547f0748 Mon Sep 17 00:00:00 2001 From: yut23 Date: Sun, 3 Dec 2023 18:37:06 -0500 Subject: [PATCH] Fix matrix --- .github/workflows/gen_matrix.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/gen_matrix.py b/.github/workflows/gen_matrix.py index 868eb5d..09af618 100644 --- a/.github/workflows/gen_matrix.py +++ b/.github/workflows/gen_matrix.py @@ -3,17 +3,21 @@ from pathlib import Path includes: list[dict[str, str]] = [] + + +def add_config(**kwargs: str) -> None: + includes.append({"compiler": "g++", **kwargs}) + includes.append({"compiler": "clang++", **kwargs}) + + changed_files = json.loads(sys.argv[1]) for file in changed_files: path = Path(file) print(path, file=sys.stderr) -includes.append({"dir": "2023", "target": "day01"}) -includes.append({"dir": "2023", "target": "day02"}) -includes.append({"dir": "2023", "target": "day03"}) -includes.append({"dir": "2022", "target": "day19"}) +add_config(dir="2023", target="day01") +add_config(dir="2023", target="day02") +add_config(dir="2023", target="day03") +add_config(dir="2022", target="day19") -matrix = { - # "compiler": ["clang++", "g++"], -} -print("matrix-combinations=" + json.dumps({**matrix, "include": includes})) +print("matrix-combinations=" + json.dumps({"include": includes}))