Skip to content

Commit

Permalink
Set gotestsum --format to github-actions when running on github (#2082)
Browse files Browse the repository at this point in the history
This gives grouping and ability to open individual test logs.
  • Loading branch information
denik authored Jan 6, 2025
1 parent 4f3cf6a commit 8af98ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
branches:
- main

env:
GOTESTSUM_FORMAT: github-actions

jobs:
tests:
runs-on: ${{ matrix.os }}
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ default: build

PACKAGES=./libs/... ./internal/... ./cmd/... ./bundle/... .

GOTESTSUM_FORMAT ?= pkgname-and-test-fails

lint:
./lint.sh ./...

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
Expand Down

0 comments on commit 8af98ac

Please sign in to comment.