Skip to content

Commit

Permalink
Adjust tests more
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Coffman <[email protected]>
  • Loading branch information
StevenACoffman committed Jun 20, 2024
1 parent b334226 commit 79dcf2d
Showing 1 changed file with 11 additions and 39 deletions.
50 changes: 11 additions & 39 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,20 @@ 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: |
set -euo pipefail
go mod download
go test -json -race ./... -trimpath 2>&1 > gotest.json
- name: Annotate tests
if: ${{ failure() }}
uses: guyarb/[email protected]
# Install gotestsum on the VM running the action.
- name: Setup gotestsum
uses: autero1/[email protected]
with:
test-results: gotest.json
- name: Convert test output to junit
gotestsum_version: v1.12.0
- name: Core tests
shell: bash
if: always()
run: |
go install gotest.tools/gotestsum@latest
export GOBIN="$(go env GOPATH)"
"${GOBIN}/bin/gotestsum" --raw-command cat gotest.json
set -euo pipefail
go mod download
gotestsum --format=github-actions -- -race ./... -trimpath
- 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 -json -race ./... -trimpath 2>&1 > ../go_examples_test.json
# gotestsum \
# --junitfile .results/results.xml \
# --jsonfile .results/results.json \
# --format testname \
# -- -coverprofile=.results/cover.out ./...
- name: Convert example test output to junit
shell: bash
if: always()
run: |
go install gotest.tools/gotestsum@latest
export GOBIN="$(go env GOPATH)"
"${GOBIN}/bin/gotestsum" --raw-command cat go_examples_test.json
cd _examples
go mod download
gotestsum --format=github-actions -- -race ./... -trimpath

0 comments on commit 79dcf2d

Please sign in to comment.