-
Notifications
You must be signed in to change notification settings - Fork 412
/
Taskfile.yml
99 lines (83 loc) · 1.9 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
version: "3"
tasks:
coverage:
deps: [test]
desc: run unit tests and create HTML coverage file
cmds:
- go tool cover -html=coverage.txt
fmt:
desc: auto-format all go files
sources:
- "**/*.go"
cmds:
- go fmt ./...
mocks:
desc: generate new mocks from scratch
deps: [mocks.remove, mocks.generate]
mocks.remove:
desc: remove all mock files
cmds:
- find . -name '*_mock.go' -o -name 'mock_*_test.go' | xargs -r rm
- rm -rf mocks/
mocks.generate:
desc: generate mockery mocks
cmds:
- go run .
docker:
desc: build the mockery docker image
cmds:
- docker build -t vektra/mockery .
mkdocs.install:
desc: install mkdocs and plugins
sources:
- "docs/requirements.txt"
cmds:
- pip install -r docs/requirements.txt
mkdocs.serve:
desc: serve mkdocs locally
deps: [mkdocs.install]
cmds:
- mkdocs serve
lint:
desc: run all the defined linters
sources:
- "**/*.go"
cmds:
- go run github.com/golangci/golangci-lint/cmd/golangci-lint run
test:
cmds:
- go run gotest.tools/gotestsum --format testname -- -v -coverprofile=coverage.txt ./...
desc: run unit tests
sources:
- "**/*.go"
generates:
- coverage.txt
test.e2e:
desc: run end-to-end tests
sources:
- "**/*.go"
- "./.mockery.yaml"
cmds:
- ./e2e/run_all.sh
test.ci:
deps: [fmt, lint]
cmds:
- task: mocks.remove
- task: mocks.generate
- task: test
- task: test.e2e
default:
deps: [test.ci]
build-tools:
desc: Build tools directory
cmds:
- cd ./tools && go build -o tools .
tag:
desc: Tag the git repo with the version specified.
deps: [build-tools]
cmds:
- ./tools/tools tag --dry-run=false
tag.push:
desc: Push tags to origin
cmds:
- git push origin --tags