mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-23 12:47:48 +00:00
be966b20c4
Pretty up the live Actions log without flooding it. Three changes: 1. .github/scripts/ci-fmt.sh — sourceable bash helpers (banner, ok, bad, warn, note, quiet_run) using ANSI colors that the Actions UI renders. 2. e2e-go.yml + e2e-ddil.yml — tofu phases switch back to quiet redirect into $TOFU_LOG (the previous tee'd version regressed live noise vs the original silent redirect). Each phase now prints one colored ok/✗ line; on failure the tail of $TOFU_LOG dumps inside a single collapsed group, so the live log stays scannable but the failing tail is one click away. 3. junit-report render.py — compact summary: short status icons (✅/❌) in a single column, no separate err column, single-line failure list (truncated to 120 chars) instead of <details> blocks that wrap badly on narrow screens. Per-suite test runs still wrap in ::group:: with an inline cyan banner so pass output collapses and the suite name is obvious when expanded.
junit-report
Composite action that renders a glob of JUnit XML files into the GitHub
Actions job summary and emits one ::error annotation per failed test case.
Usage
- name: Publish test summary
if: always()
uses: ./spinifex/.github/actions/junit-report # or your own checkout path
with:
junit-glob: ${{ env.ARTIFACT_DIR }}/junit-*.xml
title: "Go E2E results"
# fail-on-empty: "true" # opt-in: fail the step if the glob matches nothing
Outputs:
failures— total<failure>+<error>counts across all matched files.total— total<testcase>count across all matched files.
The action expects standard JUnit XML (e.g. emitted by
gotestsum --junitfile, go-junit-report, or pytest's --junitxml). Both
single <testsuite> and wrapping <testsuites> roots are accepted.
Companion convention: ::group:: for noisy steps
Long-running shell phases (tofu apply, package installs, tar-over-ssh) should
wrap their output in ::group::name / ::endgroup:: markers so the Actions
UI collapses them by default. Pattern used in the e2e-go / e2e-ddil workflows:
run() {
local label="$1"; shift
echo "::group::${label}"
"$@" 2>&1 | tee -a "$TOFU_LOG"
local rc=${PIPESTATUS[0]}
echo "::endgroup::"
return "$rc"
}
run "tofu apply" tofu apply -var-file=... -auto-approve -input=false
Combined: groups make the live UI readable; this action makes the run header land on the failures without scrolling the log.