Skip to content

Commit

Permalink
ci: merge graph output
Browse files Browse the repository at this point in the history
Signed-off-by: Zxilly <[email protected]>
  • Loading branch information
Zxilly committed Oct 21, 2024
1 parent ab722e8 commit abe935b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scripts/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def generate_image_url(p: str) -> str:
if not os.path.exists(results):
raise FileNotFoundError(f"Directory {results} does not exist")

graphs = ""

for root, dirs, files in os.walk(results):
for file in files:
if file.endswith(".output.txt"):
Expand All @@ -77,8 +79,9 @@ def generate_image_url(p: str) -> str:

if file.endswith(".graph.svg"):
image_url = generate_image_url(str(os.path.join(root, file)))
write_github_summary(header(f"Graph for `{file}`", header_level=4) + '\n')
write_github_summary(
details(f'<img src="{image_url}" alt="{file}" width="900" />')
+ '\n'
)
graphs += header(f"Graph for `{file}`", header_level=4) + '\n'
graphs += f'<img src="{image_url}" alt="{file}" width="900" />' + '\n'

if graphs:
write_github_summary(header("Graphs", header_level=3) + '\n')
write_github_summary(details(graphs) + '\n')

0 comments on commit abe935b

Please sign in to comment.