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}))