-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Toma Puljak <[email protected]>
- Loading branch information
Showing
1 changed file
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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() |