10 HERALD_URL =
"https://herald.dokku.paulgessinger.com/view/{repo}/runs/{run_id}/artifacts/{artifact_name}/{path}"
11 IS_CI =
"GITHUB_ACTIONS" in os.environ
14 parser = argparse.ArgumentParser()
15 parser.add_argument(
"results")
16 parser.add_argument(
"--html")
17 parser.add_argument(
"--md")
18 args = parser.parse_args()
20 re_title = re.compile(
r'<p class="title">\s*(.*)\s*<\/p>', re.RegexFlag.MULTILINE)
21 re_check = re.compile(
r'<a.*title="(.*)">\s*(.)\s*<\/a>', re.RegexFlag.MULTILINE)
25 with
open(args.results)
as f:
26 reader = csv.reader(f)
27 for title, slug, ec
in reader:
32 "path": f
"{slug}.html",
37 with
open(args.html, mode=
"w", encoding=
"utf-8")
as f:
42 <title>physmon summary</title>
43 <meta charset="UTF-8">
46 <h1>physmon summary</h1>
54 <li>{"✅" if s["total"] else "🔴"} <a href="{s["path"]}">{s["title"]}</a></li>"""
66 with
open(args.md, mode=
"w", encoding=
"utf-8")
as f:
67 f.write(
"# physmon summary\n")
70 url = HERALD_URL.format(
71 repo=os.environ[
"GITHUB_REPOSITORY"],
72 run_id=os.environ[
"GITHUB_RUN_ID"],
73 artifact_name=
"physmon",
78 f.write(f
" - {'✅' if s['total'] else '🔴'} [{s['title']}]({url})\n")