-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTaskfile.yml
More file actions
62 lines (58 loc) · 1.33 KB
/
Taskfile.yml
File metadata and controls
62 lines (58 loc) · 1.33 KB
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
# https://taskfile.dev
version: "3"
tasks:
install:gofumpt:
status:
- which gofumpt
cmds:
# https://github.com/mvdan/gofumpt
- go install mvdan.cc/gofumpt@latest
install:golangci-lint:
status:
- test -f ./bin/golangci-lint
- ./bin/golangci-lint --version | grep -F '2.8.0'
cmds:
# https://golangci-lint.run/welcome/install/#binaries
- >
curl -sSfL
https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh
| sh -s -- -b ./bin v2.8.0
release:
cmds:
- test {{.CLI_ARGS}}
- git tag v{{.CLI_ARGS}}
- git push
- git push --tags
- gh release create --generate-notes v{{.CLI_ARGS}}
update-examples:
vars:
EXAMPLES:
sh: ls -1 _examples
cmds:
- for:
var: EXAMPLES
split: "\n"
cmd: cd _examples/{{.ITEM}} && go get -u . && go mod tidy
format:
cmds:
- task: install:gofumpt
- gofumpt -w .
- go mod edit -fmt
- go mod tidy
lint:
cmds:
- task: install:golangci-lint
- ./bin/golangci-lint run
test:
cmds:
- go test -count 1 ./...
- ff test
all:
desc: run all code formatters, linters, and tests
cmds:
- task: format
- task: lint
- task: test
default:
cmds:
- task: all