-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: check compiler compatibility in separate workflow
* trigger weekly, on release/master branches, and on manual dispatch * create compatibility report for platform/toolchain/version combos * if changed and not on release/master, open PR autoupdating README
- Loading branch information
Showing
8 changed files
with
435 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
Updates compatibility tables in a markdown file. | ||
""" | ||
|
||
import re | ||
import sys | ||
from pathlib import Path | ||
|
||
name = sys.argv[1] # name of the table, e.g. "compile", "test" | ||
compat_path = Path(sys.argv[2]) # compatibility report path | ||
update_path = Path(sys.argv[3]) # path to markdown file to update | ||
|
||
assert compat_path.is_file() | ||
assert update_path.is_file() | ||
|
||
with open(compat_path, "r") as compat: | ||
table = "".join(compat.readlines()) | ||
r = re.compile( | ||
r"<!\-\- " | ||
+ name | ||
+ r" compat starts \-\->.*<!\-\- " | ||
+ name | ||
+ r" compat ends \-\->", | ||
re.DOTALL, | ||
) | ||
ct = ( | ||
"<!-- " | ||
+ name | ||
+ " compat starts -->{}<!-- ".format("\n{}\n".format(table)) | ||
+ name | ||
+ " compat ends -->" | ||
) | ||
readme = update_path.open().read() | ||
update_path.open("w").write(r.sub(ct, readme)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
Converts compatibility reports from long to wide format | ||
and makes a markdown table from the wide format report. | ||
""" | ||
|
||
from pathlib import Path | ||
import pandas as pd | ||
import sys | ||
|
||
ip = Path(sys.argv[1]) # input file path | ||
op = Path(sys.argv[2]) # output file path | ||
|
||
assert ip.is_file() | ||
assert ip.suffix == ".csv" | ||
assert op.suffix == ".csv" | ||
|
||
df = pd.pivot( | ||
pd.read_csv(ip), | ||
index="runner", | ||
columns=["compiler", "version"], | ||
values="support", | ||
).sort_values(by=["runner"]) | ||
df.to_csv(op) | ||
with open(op.with_suffix(".md"), "w") as file: | ||
file.write( | ||
df.to_markdown() | ||
.replace("nan", "") | ||
.replace("(", "") | ||
.replace(")", "") | ||
.replace(",", "") | ||
.replace("'", "") | ||
) |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.