-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
73 lines (60 loc) · 1.59 KB
/
Copy pathTaskfile.yml
File metadata and controls
73 lines (60 loc) · 1.59 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
version: '3'
# Reusable command runner for the ubgo/cache-obj 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 ./...
cover:
desc: Coverage of the product package (root); prints the total
cmds:
- go test -coverprofile=cover.out -covermode=atomic .
- go tool cover -func=cover.out | tail -1
cover:all:
desc: Coverage across all packages (objtest's failure-assertion branches are uncoverable by design)
cmds:
- go test -coverpkg=./... -coverprofile=cover.out -covermode=atomic ./...
- go tool cover -func=cover.out | tail -1
test:coverage:
desc: HTML coverage report for the product package
cmds:
- go test -race -coverprofile=cover.out .
- go tool cover -html=cover.out -o cover.html
- echo "Coverage report written to cover.html"
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
check:
desc: Full local gate (fmt + vet + lint + race tests + 100% product coverage)
cmds:
- task: fmt:check
- task: vet
- task: lint
- task: test:race
- task: cover