Skip to content

Commit 69fc7c5

Browse files
authored
Merge pull request #6 from per1234/taskfile
Add taskfile for building and testing Go code
2 parents 3874cba + d58042a commit 69fc7c5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Taskfile.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See: https://taskfile.dev/#/usage
2+
version: "3"
3+
4+
vars:
5+
DEFAULT_GO_PACKAGES:
6+
sh: echo $(go list ./... | tr '\n' ' ')
7+
8+
tasks:
9+
check:
10+
desc: Check for problems with the project
11+
deps:
12+
- task: go:test
13+
14+
go:build:
15+
desc: Build the project
16+
cmds:
17+
- go build -v {{.GO_BUILD_FLAGS}}
18+
19+
go:test:
20+
desc: Run unit tests
21+
cmds:
22+
- go test -v -short -run '{{default ".*" .GO_TEST_REGEX}}' {{default "-timeout 10m -coverpkg=./... -covermode=atomic" .GO_TEST_FLAGS}} -coverprofile=coverage_unit.txt {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
23+

0 commit comments

Comments
 (0)