-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathTaskfile.yml
More file actions
61 lines (52 loc) · 1.37 KB
/
Taskfile.yml
File metadata and controls
61 lines (52 loc) · 1.37 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
version: '3'
vars:
BIN: bin/mkdev
PKG: ./...
GOFLAGS: -trimpath
VERSION:
sh: git describe --tags --dirty --always 2>/dev/null || echo "dev"
COMMIT:
sh: git rev-parse --short HEAD 2>/dev/null || echo "none"
DATE:
sh: date -u +%Y-%m-%dT%H:%M:%SZ
LDFLAGS: >-
-X github.com/venkatkrishna07/mkdev/internal/version.Version={{.VERSION}}
-X github.com/venkatkrishna07/mkdev/internal/version.Commit={{.COMMIT}}
-X github.com/venkatkrishna07/mkdev/internal/version.Date={{.DATE}}
tasks:
default:
desc: List tasks
cmds:
- task --list
build:
desc: Build mkdev binary
cmds:
- mkdir -p bin
- go build {{.GOFLAGS}} -ldflags "{{.LDFLAGS}}" -o {{.BIN}} ./cmd/mkdev
test:
desc: Run tests with race detector
cmds:
- go test {{.GOFLAGS}} -race -count=1 -timeout=60s {{.PKG}}
lint:
desc: Run golangci-lint
cmds:
- golangci-lint run
run:
desc: Build and run mkdev
deps: [build]
cmds:
- "{{.BIN}}"
coverage:
desc: Run tests with coverage report
cmds:
- go test {{.GOFLAGS}} -race -count=1 -coverprofile=coverage.txt -covermode=atomic {{.PKG}}
- go tool cover -func=coverage.txt | tail -1
tidy:
desc: Tidy modules and format code
cmds:
- go mod tidy
- gofmt -w .
clean:
desc: Remove build artifacts
cmds:
- rm -rf bin coverage.txt