Set gotestsum --format to github-actions when running on github (#2082)

This gives grouping and ability to open individual test logs.
This commit is contained in:
Denis Bilenko 2025-01-06 14:12:34 +01:00 committed by GitHub
parent 4f3cf6ac2c
commit 8af98accee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -14,6 +14,9 @@ on:
branches:
- main
env:
GOTESTSUM_FORMAT: github-actions
jobs:
tests:
runs-on: ${{ matrix.os }}

View File

@ -2,6 +2,8 @@ default: build
PACKAGES=./libs/... ./internal/... ./cmd/... ./bundle/... .
GOTESTSUM_FORMAT ?= pkgname-and-test-fails
lint:
./lint.sh ./...
@ -9,10 +11,10 @@ lintcheck:
golangci-lint run ./...
test:
gotestsum --format pkgname-and-test-fails --no-summary=skipped -- ${PACKAGES}
gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=skipped -- ${PACKAGES}
cover:
gotestsum --format pkgname-and-test-fails --no-summary=skipped -- -coverprofile=coverage.txt ${PACKAGES}
gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=skipped -- -coverprofile=coverage.txt ${PACKAGES}
showcover:
go tool cover -html=coverage.txt