Skip to content

Commit 03cd5f6

Browse files
authored
Add color coding to test status in summary
1 parent e91785e commit 03cd5f6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎.github/workflows/relocatability.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ jobs:
8585
run: |
8686
import json, os
8787
88+
colours = {"PASS": "🟢", "FAIL": "🔴", "SKIP": "🟡"}
89+
8890
lines = []
8991
for strategy in ("patch", "origin"):
9092
# Fails the job if the harness crashed instead of reporting.
9193
with open(f"results-{strategy}.json") as file:
9294
results = json.load(file)
9395
lines += [f"### `--strategy {strategy}`", "", "| Check | Status | Summary |", "|---|---|---|"]
94-
lines += [f"| `{r['name']}` | {r['status']} | {r['summary']} |" for r in results]
96+
lines += [f"| `{r['name']}` | {colours[r['status']]} {r['status']} | {r['summary']} |" for r in results]
9597
lines.append("")
9698
with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as summary:
9799
summary.write("\n".join(lines) + "\n")

0 commit comments

Comments
 (0)