From bfa5f3048a9b1fd41d5617d1306b459d8d1be698 Mon Sep 17 00:00:00 2001 From: Justin Stayton Date: Thu, 27 Aug 2026 12:26:35 -0400 Subject: [PATCH] Report test results & coverage in the CI run summary The suite already ran with coverage and uploaded both reports as artifacts, so the numbers were only visible by downloading an artifact or scrolling the job log. This posts them to the run summary instead, in the same shape as the jobs in vision-download and webhook-verifier-nodejs. The job runs once on 26.x rather than across the 22/24/26 matrix, so the run gets one summary rather than three, and `Lint & test` is untouched. Artifacts still come from that job, per Node version, so this one only writes the summary. Co-Authored-By: Claude Opus 5 --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5d41ae..25a200a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,3 +37,40 @@ jobs: with: name: test-coverage-${{ matrix.node-version }} path: test/coverage + + test-coverage: + name: Test coverage + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - name: Set up Node.js + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 + with: + node-version: '26.x' + cache: 'npm' + - name: Install npm dependencies + run: npm install + - name: Run tests + run: | + set -o pipefail + npm test -- --ci --coverage --runInBand 2>&1 | + tee "$RUNNER_TEMP/tests.txt" + # Reported in its own step so the summary is still written when the suite + # fails, which is when the test results are most worth reading. + - name: Report test results & coverage + if: ${{ !cancelled() }} + run: | + { + echo '## Tests' + echo + echo '```' + grep -E '^(Test Suites|Tests|Snapshots|Time):' "$RUNNER_TEMP/tests.txt" + echo '```' + echo + echo '## Test coverage' + echo + echo '```' + awk '/^-+\|/ { f = 1 } /^Test Suites:/ { f = 0 } f' "$RUNNER_TEMP/tests.txt" + echo '```' + } >> "$GITHUB_STEP_SUMMARY"