mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 04:14:27 +02:00
fix boolean conan options in dynamic CI matrix
This commit is contained in:
19
.github/job_matrix.py
vendored
19
.github/job_matrix.py
vendored
@@ -35,12 +35,21 @@ class MatrixElement:
|
||||
contracts: typing.Literal["none", "gsl-lite", "ms-gsl"]
|
||||
build_type: typing.Literal["Release", "Debug"]
|
||||
|
||||
def as_json(self):
|
||||
def dataclass_to_json(obj):
|
||||
"""Convert dataclasses to something json-serialisable"""
|
||||
if dataclasses.is_dataclass(obj):
|
||||
return {
|
||||
k: dataclass_to_json(v) for k, v in dataclasses.asdict(obj).items()
|
||||
}
|
||||
return obj
|
||||
|
||||
def dataclass_to_json(obj):
|
||||
"""Convert dataclasses to something json-serialisable"""
|
||||
if dataclasses.is_dataclass(obj):
|
||||
return dataclasses.asdict(obj)
|
||||
raise TypeError(f"Unknown object of type {type(obj).__name__}")
|
||||
ret = dataclass_to_json(self)
|
||||
# patch boolean conan configuration options
|
||||
config = ret["config"]
|
||||
for k in ["cxx_modules"]:
|
||||
config[k] = "True" if config[k] else "False"
|
||||
return ret
|
||||
|
||||
|
||||
class CombinationCollector:
|
||||
|
Reference in New Issue
Block a user