/
Taskfile.yml
106 lines (92 loc) · 2.17 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
version: '3'
tasks:
default:
cmds:
- task: build:gowork
- task: generate
- task: mod
- task: lint:golangci-lint
github-action:
cmds:
- task: build:gowork
- task: generate
- task: lint:golangci-lint
- task: lint:files-changed
- task: test
build:gowork:
run: once
sources:
- /ext
- /tests
- /examples
generates:
- go.work
- go.work.sum
cmds:
- go work init
- go work use -r .
build:kod:
cmds:
- go build -o kod ./cmd/kod
sources:
- "**/**.go"
generates:
- kod
generate:struct2interface:
cmds:
- go run ./cmd/kod struct2interface .
deps:
- install:mockgen
generate:
cmds:
- go run ./cmd/kod generate ./... ./tests/... ./examples/... ./ext/...
deps:
- generate:struct2interface
lint:golangci-lint:
cmd: |
golangci-lint run ./...
deps:
- install:golangci-lint
lint:files-changed:
cmd: |
git diff --exit-code
test:
cmd: |
GOEXPERIMENT=nocoverageredesign go test -race -cover -coverprofile=coverage.out \
-covermode=atomic ./... ./tests/... ./examples/... \
-coverpkg .,./cmd/...,./internal/...
sources:
- "**/**.go"
generates:
- coverage.out
test:coverage:
cmd: |
go tool cover -func=coverage.out
deps:
- test
install:mockgen:
vars:
VERSION: cat go.mod|grep go.uber.org/mock |awk -F ' ' '{print $2}'
status:
- go version -m $GOPATH/bin/mockgen | grep go.uber.org/mock | grep {{.VERSION}}
cmd: |
go install go.uber.org/mock/mockgen@{{.VERSION}}
install:golangci-lint:
vars:
VERSION: v1.56.2
status:
- go version -m $GOPATH/bin/golangci-lint | grep github.com/golangci/golangci-lint | grep {{.VERSION}}
cmd: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@{{.VERSION}}
mod:
cmds:
- go mod tidy
- cd tests && go mod tidy
- cd examples && go mod tidy
- cd ext && go mod tidy
release:
vars:
VERSION: v0.6.0
cmds:
- git tag {{.VERSION}}
- git tag ext/{{.VERSION}}