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 5d8cd13
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,55 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
# Install gotestfmt on the VM running the action.
- name: Core tests
uses: nick-fields/retry@v3
with:
shell: bash
max_attempts: 3
timeout_minutes: 20
command: |
go mod download
go test -race ./...
go test -json -race ./... -trimpath 2>&1 > gotest.json
- name: Annotate tests
if: ${{ failure() }}
uses: guyarb/[email protected]
with:
test-results: gotest.json
- name: Convert test output to junit
if: always()
run: |
go install gotest.tools/gotestsum@latest
$(go env GOPATH)/bin/gotestsum --junitfile report.xml --raw-command cat gotest.json
- name: Example tests
uses: nick-fields/retry@v3
with:
shell: bash
max_attempts: 3
timeout_minutes: 20
command: |
cd _examples
go mod download
go test -race ./...
go test -json -race ./... -trimpath 2>&1 > ../go_examples_test.json
cd ..
# gotestsum \
# --junitfile .results/results.xml \
# --jsonfile .results/results.json \
# --format testname \
# -- -coverprofile=.results/cover.out ./...
- name: Convert example test output to junit
if: always()
run: |
go install gotest.tools/gotestsum@latest
$(go env GOPATH)/bin/gotestsum --junitfile go_examples_report.xml --raw-command cat go_examples_test.json
ls -la .
- name: Test summary
id: unit-tests-summary
if: always()
uses: test-summary/action@v2
with:
show: "all"
# output: $GITHUB_STEP_SUMMARY
paths: |
report.xml
go_examples_report.xml

0 comments on commit 5d8cd13

Please sign in to comment.