From 03cd5f6896eb488104f2cf93718bdf88f03c6ea1 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 6 Nov 2026 14:51:28 -0700 Subject: [PATCH] Add color coding to test status in summary --- .github/workflows/relocatability.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/relocatability.yml b/.github/workflows/relocatability.yml index 23a2c2d..f219ba3 100644 --- a/.github/workflows/relocatability.yml +++ b/.github/workflows/relocatability.yml @@ -85,13 +85,15 @@ jobs: run: | import json, os + colours = {"PASS": "🟢", "FAIL": "🔴", "SKIP": "🟡"} + lines = [] for strategy in ("patch", "origin"): # Fails the job if the harness crashed instead of reporting. with open(f"results-{strategy}.json") as file: results = json.load(file) lines += [f"### `--strategy {strategy}`", "", "| Check | Status | Summary |", "|---|---|---|"] - lines += [f"| `{r['name']}` | {r['status']} | {r['summary']} |" for r in results] + lines += [f"| `{r['name']}` | {colours[r['status']]} {r['status']} | {r['summary']} |" for r in results] lines.append("") with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as summary: summary.write("\n".join(lines) + "\n")