From ca405f977dfd3bcc54eba377b253494158977104 Mon Sep 17 00:00:00 2001 From: Kinneyzhang Date: Sun, 26 Jul 2026 23:55:20 +0800 Subject: [PATCH] CI: surface doctest failures as annotations Job logs are not anonymously readable; emit FAIL/expected/got lines (or the log tail on a load error) as ::error:: annotations so the failing assertion is visible through the public Checks API. Co-Authored-By: Claude Fable 5 --- .github/workflows/ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99447f8..e590ce1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,4 +43,14 @@ jobs: run: make test-shuffled LOAD_EXTRA="$LOAD_EXTRA" - name: README doctests - run: make doctest LOAD_EXTRA="$LOAD_EXTRA" + run: | + set -o pipefail + make doctest LOAD_EXTRA="$LOAD_EXTRA" 2>&1 | tee doctest.log || { + # Surface failing assertions as annotations (job logs are + # not readable anonymously; annotations are). + grep -E '^(FAIL| expected:| got:)' doctest.log | head -30 \ + | while IFS= read -r l; do echo "::error::${l}"; done + grep -q '^FAIL' doctest.log || tail -n 8 doctest.log \ + | while IFS= read -r l; do echo "::error::${l}"; done + exit 1 + }