-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
51 lines (42 loc) · 965 Bytes
/
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
version: "3"
env:
GOBIN: "{{ .ROOT_DIR }}/bin"
PATH: "{{ .GOBIN }}:{{ .PATH }}"
tasks:
install-binary:
cmds:
- go install {{ .DEP_MODULE }}@{{ .DEP_VERSION }}
status:
- test -d {{ .GOBIN }}
- test -f {{ .GOBIN }}/{{ base .DEP_MODULE }}
internal: true
binaries:
deps:
- task: install-binary
vars:
DEP_VERSION: v1.50.0
DEP_MODULE: github.com/golangci/golangci-lint/cmd/golangci-lint
- task: install-binary
vars:
DEP_VERSION: latest
DEP_MODULE: golang.org/x/tools/cmd/goimports
lint:
deps: [binaries]
cmds:
- golangci-lint run {{ .ROOT_DIR }}/...
imports:
deps: [binaries]
cmds:
- goimports -w {{ .ROOT_DIR }}
build:
cmds:
- go build -o {{ .GOBIN }}/fts -tags fts5
tidy:
cmds:
- go mod tidy
precommit:
cmds:
- task: tidy
- task: imports
- task: lint
- task: build