-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Taskfile.yml
89 lines (76 loc) · 2.56 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
version: "3"
tasks:
build:
desc: "Build the project using the Dockerfile go installation"
cmds:
- docker build -t mollie-go:latest -f Dockerfile .
silent: true
run:
desc: "Run the tests using the Dockerfile go installation"
cmds:
- docker run --rm mollie-go:latest
silent: true
ci-lint:
desc: "Run all linters used in the CI pipeline"
cmds:
- golangci-lint run --out-format=tab --issues-exit-code=0 --sort-results --skip-dirs-use-default --tests=false --presets=bugs,complexity,format,performance,style,unused
silent: true
pr-lint:
desc: "Run all linters used in the PR pipeline"
cmds:
- golangci-lint run --issues-exit-code=0 --out-format=github-actions --new=true --sort-results --skip-dirs-use-default --tests=false --presets=bugs,complexity,format,performance,style,unused
silent: true
ci-all-presets:
desc: "Run all linters' presets available in golangci-lint"
cmds:
- golangci-lint run --out-format=tab --issues-exit-code=0 --sort-results --skip-dirs-use-default --tests=false --presets=bugs,comment,complexity,error,format,import,metalinter,module,performance,sql,style,test,unused
silent: true
lint:
desc: "Run the go linters"
cmds:
- go version
- echo "Running go lint"
- golint ./...
- echo "Running go vet"
- go vet ./...
silent: false
test:
desc: "Run tests using the Dockerfile go installation"
cmds:
- task: run
silent: false
test-local:
desc: "Run tests using a local go installation"
cmds:
- go test -failfast ./... -coverprofile cover.out
silent: false
coverage:
desc: "Run tests and generate a default coverage report"
cmds:
- go tool cover -func=cover.out
silent: false
cover-report:
desc: "Run tests and generate coverage report in HTML format"
cmds:
- go tool cover -html=cover.out
silent: false
clean:
desc: "Verify and tidy go modules"
cmds:
- go mod verify
- go mod tidy
silent: false
update-docs:
desc: "Update the generated docs for the mollie package"
cmds:
- gomarkdoc --output docs/README.md ./mollie
- git add --all
- "git commit --message 'chore(docs): update generated docs'"
silent: false
sub-pkg-docs:
desc: "Update the generated docs for the sub-packages"
cmds:
- gomarkdoc ./pkg/connect > docs/pkg/connect/README.md
- gomarkdoc ./pkg/idempotency > docs/pkg/idempotency/README.md
- gomarkdoc ./pkg/pagination > docs/pkg/pagination/README.md
silent: false