Skip to content

Commit

Permalink
Add prettier test results
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Coffman <[email protected]>
  • Loading branch information
StevenACoffman committed Jun 19, 2024
1 parent 1422ff2 commit 9835dc2
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,41 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
# Install gotestfmt on the VM running the action.
- name: Set up gotestfmt
uses: GoTestTools/gotestfmt-action@v2
- name: Core tests
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 20
command: |
go mod download
go test -race ./...
go test -json -race ./... -trimpath 2>&1 > /tmp/gotest.json
- name: Format log output
if: always()
run: |
set -euo pipefail
cat /tmp/gotest.json | gotestfmt
- name: Annotate tests
if: always()
uses: guyarb/[email protected]
with:
test-results: /tmp/gotest.json
- name: Convert test output to junit
if: always()
run: |
go install gotest.tools/gotestsum@latest
$(go env GOPATH)/bin/gotestsum --junitfile /tmp/report.xml --raw-command cat /tmp/gotest.json
- name: Test summary
id: unit-tests-summary
if: always()
uses: test-summary/action@v2
with:
paths: |
/tmp/report.xml
output: test-summary.md
show: "fail"
- name: Example tests
uses: nick-fields/retry@v3
with:
Expand Down

0 comments on commit 9835dc2

Please sign in to comment.