-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
50 lines (48 loc) · 1.37 KB
/
Taskfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
version: '3'
vars:
LOCAL_BIN: bin
tasks:
## Setup
setup:mockery:
internal: true
cmds:
- test -s {{.LOCAL_BIN}}/mockery || GOBIN=$(pwd)/{{.LOCAL_BIN}} go install github.com/vektra/mockery/[email protected]
setup:golangci-lint:
internal: true
cmds:
- test -s {{.LOCAL_BIN}}/golangci-lint || GOBIN=$(pwd)/{{.LOCAL_BIN}} go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
setup:go-test-coverage:
internal: true
cmds:
- test -s {{.LOCAL_BIN}}/go-test-coverage || GOBIN=$(pwd)/{{.LOCAL_BIN}} go install github.com/vladopajic/go-test-coverage/v2@latest
## Development
mockery:
deps: [setup:mockery]
cmds:
- "{{.LOCAL_BIN}}/mockery"
fmt:
cmds:
- go fmt ./...
lint:
deps: [setup:golangci-lint, mockery]
cmds:
- task: fmt
- "{{.LOCAL_BIN}}/golangci-lint run --timeout 15m ./..."
build:
cmds:
- go build ./...
test:
env:
GO111MODULE: on
deps:
- task: mockery
cmds:
- go clean -testcache
- go test -coverprofile=coverage.out ./...
cover:
deps:
- task: mockery
- task: setup:go-test-coverage
- task: test
cmds:
- "{{.LOCAL_BIN}}/go-test-coverage --threshold-file 80 --threshold-package 80 --threshold-total 95 --profile coverage.out --config ./.testcoverage.yml"