-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathTaskfile.yml
70 lines (61 loc) · 1.41 KB
/
Taskfile.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
version: '3'
env:
GOBIN: { sh: pwd }
tasks:
default:
cmds:
- task: generate
github-action:
cmds:
- task: test
- task: lint:files-changed
build:gowork:
run: once
status:
- test -f ../go.work || test -f go.work
cmds:
- go work init
- go work use -r .
generate:
cmds:
- PATH=$PATH:$GOBIN go run ./cmd/kod generate -s ./... ./tests/...
sources:
- "**/**.go"
deps:
- task: build:gowork
- task: mod
- install:mockgen
lint:files-changed:
cmd: |
git diff --exit-code
test:
cmd: |
PATH=$PATH:$GOBIN GOEXPERIMENT=nocoverageredesign go test -race -cover -coverprofile=coverage.out \
-covermode=atomic ./... ./tests/... \
-coverpkg .,./cmd/...,./internal/...,./interceptor/...
git checkout tests/case1/kod_gen_mock.go
sources:
- "**/**.go"
generates:
- coverage.out
deps:
- task: generate
test:coverage:
cmd: |
go tool cover -func=coverage.out
deps:
- test
install:mockgen:
vars:
VERSION:
sh: |
cat go.mod|grep go.uber.org/mock |awk -F ' ' '{print $2}'
status:
- test -f mockgen
- go version -m $GOBIN/mockgen | grep go.uber.org/mock | grep {{.VERSION}}
cmd: |
go install go.uber.org/mock/mockgen@{{.VERSION}}
mod:
cmds:
- go mod tidy
- cd tests && go mod tidy