-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
96 lines (79 loc) · 2.37 KB
/
Taskfile.yml
File metadata and controls
96 lines (79 loc) · 2.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: '3'
# Reusable command runner for the ubgo/cache-cli repo.
# Run `task --list` to see all available tasks.
tasks:
default:
desc: Show available tasks
cmds:
- task --list
test:
desc: Run all tests
cmds:
- go test ./...
test:race:
desc: Run all tests with the race detector
cmds:
- go test -race -count=2 ./...
test:coverage:
desc: Run tests with an HTML coverage report
cmds:
- go test -race -coverprofile=cover.out ./...
- go tool cover -html=cover.out -o cover.html
- echo "Coverage report written to cover.html"
bench:
desc: Run conformance benchmarks against miniredis
cmds:
- go test -bench=. -benchmem -run='^$' ./...
vet:
desc: Run go vet
cmds:
- go vet ./...
lint:
desc: Run golangci-lint
cmds:
- golangci-lint run ./...
fmt:
desc: Format all Go files
cmds:
- gofmt -w .
fmt:check:
desc: Fail if any file is not gofmt-clean
cmds:
- test -z "$(gofmt -l .)"
tidy:
desc: Tidy go.mod
cmds:
- go mod tidy
release:dryrun:
desc: Print the next tags for each bump without tagging
cmds:
- 'echo "current: $(git describe --tags --abbrev=0 2>/dev/null || echo none)"'
- 'echo "patch -> $(sh scripts/nextver.sh patch)"'
- 'echo "minor -> $(sh scripts/nextver.sh minor)"'
- 'echo "major -> $(sh scripts/nextver.sh major)"'
release:patch:
desc: Tag the next patch release (no push)
cmds:
- 'git tag "$(sh scripts/nextver.sh patch)"'
- 'echo "tagged $(git describe --tags --abbrev=0). Push with: git push origin --tags"'
release:minor:
desc: Tag the next minor release (no push)
cmds:
- 'git tag "$(sh scripts/nextver.sh minor)"'
- 'echo "tagged $(git describe --tags --abbrev=0). Push with: git push origin --tags"'
release:major:
desc: Tag the next major release (no push)
cmds:
- 'git tag "$(sh scripts/nextver.sh major)"'
- 'echo "tagged $(git describe --tags --abbrev=0). Push with: git push origin --tags"'
cover:
desc: Run tests with coverage and print the total
cmds:
- go test -coverprofile=cover.out -covermode=atomic ./...
- go tool cover -func=cover.out | tail -1
check:
desc: Full local gate (fmt + vet + race tests)
cmds:
- task: fmt:check
- task: vet
- task: test:race