-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
62 lines (52 loc) · 1.3 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:
GO_MODULE: github.com/rebelopsio/duet
BUILD_DIR: "{{.ROOT_DIR}}/dist"
COVERAGE_DIR: "{{.ROOT_DIR}}/coverage"
tasks:
default:
cmds:
- task: test
clean:
desc: Clean build artifacts
cmds:
- rm -rf {{.BUILD_DIR}}
- rm -rf {{.COVERAGE_DIR}}
ensure-lint:
internal: true
cmds:
- |
if ! command -v golangci-lint &> /dev/null; then
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
fi
lint:
desc: Run golangci-lint
deps: [ensure-lint]
cmds:
- golangci-lint run --config=.golangci.yml
test:
desc: Run tests
cmds:
- mkdir -p {{.COVERAGE_DIR}}
- go test -race -coverprofile={{.COVERAGE_DIR}}/coverage.out -covermode=atomic ./...
build:
desc: Build binary
deps: [clean]
cmds:
- mkdir -p {{.BUILD_DIR}}
- go build -o {{.BUILD_DIR}}/duet cmd/duet/main.go
install-tools:
desc: Install development tools
cmds:
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- go install github.com/goreleaser/goreleaser@latest
generate:
desc: Run go generate
cmds:
- go generate ./...
pre-commit:
desc: Run pre-commit checks
cmds:
- task: generate
- task: lint
- task: test