-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ChristoWolf/issue/1
feat: created Taskfile for testing and covering Go code
- Loading branch information
Showing
2 changed files
with
29 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: '3' | ||
|
||
output: prefixed | ||
|
||
vars: | ||
COVERNAME: 'coverage' | ||
COVEREXT: '.out' | ||
COVERFILE: '{{.COVERNAME}}{{.COVEREXT}}' | ||
COVERHTML: '{{.COVERNAME}}.html' | ||
|
||
tasks: | ||
|
||
go-test: | ||
desc: 'runs `go test` in race detection and atomic coverage collection mode' | ||
dir: '{{.USER_WORKING_DIR}}' | ||
cmds: | ||
- cmd: go test -v ./... -race -coverprofile={{.COVERFILE}} -covermode=atomic | ||
|
||
go-cover: | ||
desc: 'runs the go-test task, the `cover` Go tool and displays the generated HTML report' | ||
dir: '{{.USER_WORKING_DIR}}' | ||
deps: | ||
- task: go-test | ||
cmds: | ||
- cmd: go tool cover -html={{.COVERFILE}} -o {{.COVERHTML}} | ||
- cmd: cmd /c start {{.COVERHTML}} | ||
platforms: [windows] | ||
|
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
# taskfiles | ||
A collection of Taskfiles for https://taskfile.dev/ | ||
# A collection of Taskfiles for [Task](https://taskfile.dev/) |