Skip to content

Commit

Permalink
chore: gotestsum
Browse files Browse the repository at this point in the history
Signed-off-by: Toma Puljak <[email protected]>
  • Loading branch information
Tpuljak committed Apr 22, 2024
1 parent 1dddfdb commit 27e656f
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/lint_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
git diff --exit-code pkg/serverapiclient/* || (echo "API clients are out of sync! Please generate with './hack/swagger.sh' and commit" && exit 1)
git diff --exit-code '**/*.go' || (echo "Code is not formatted! Please run 'go fmt ./...' and commit" && exit 1)
test:
name: Run Go unit tests and check package coverage
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -50,4 +50,45 @@ jobs:
- uses: robherley/go-test-action@v0
with:
testArguments: -tags testing ./...
omit: untested
omit: untested
gotestsum:
name: Gotestsum
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- run: go build -tags testing ./...
- run: go install gotest.tools/gotestsum@latest
- run: go run gotest.tools/gotestsum@latest --junitfile unit-tests.xml --format pkgname -- -coverprofile=coverage.out -covermode=atomic -coverpkg=./... -tags=testing ./...
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Unit tests # Name of the check run which will be created
path: unit-tests.xml # Path to test results
reporter: jest-junit # Format of test results
- name: check test coverage
uses: vladopajic/go-test-coverage@v2
if: success() || failure() # run this step even if previous step failed
with:
# Configure action by specifying input parameters individually (option 2).
# If you are using config file (option 1) you shouldn't use these parameters, however
# specifting these action parameters will override appropriate config values.
profile: cover.out
local-prefix: "github.com/daytonaio/daytona"
# - name: Code Coverage Report
# uses: irongut/[email protected]
# if: success() || failure() # run this step even if previous step failed
# with:
# filename: coverage.out
# badge: true
# format: markdown
# output: both
# - name: Test Summary
# uses: test-summary/action@v2
# with:
# paths: "unit-tests.xml"
# if: always()

0 comments on commit 27e656f

Please sign in to comment.