-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTaskfile.yml
62 lines (52 loc) · 1.15 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
version: "3"
vars:
PROGRAM: gosocks
tasks:
deps:
cmds:
- go mod tidy -v
update:
cmds:
- go get -u
- go mod tidy -v
setup:
cmds:
- go install mvdan.cc/gofumpt@latest
build:
aliases: [default]
deps: [deps]
env:
CGO_ENABLED: 0
cmds:
- go fmt ./...
- gofumpt -l -w .
- go vet ./...
- go build -o {{.PROGRAM}} examples/default/main.go
build-examples:
cmds:
- go build examples/default/main.go
- go build examples/custom/main.go
test:
deps: [deps]
env:
CGO_ENABLED: 1 # required by -race
cmds:
- go test -race -cover ./...
lint:
cmds:
- golangci-lint run ./... --timeout=30m
- go mod tidy
lint-update:
cmds:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b {{ .GOPATH }}/bin
- golangci-lint --version
vars:
GOPATH:
sh: go env GOPATH
tag:
cmds:
- git tag -a "${TAG}" -m "${TAG}"
- git push origin "${TAG}"
preconditions:
- sh: '[[ -n "${TAG}" ]]'
msg: "Please set the TAG environment variable"