-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
82 lines (69 loc) · 1.9 KB
/
Copy pathTaskfile.yml
File metadata and controls
82 lines (69 loc) · 1.9 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
version: '3'
# Reusable command runner for the ubgo/buildinfo repo.
# Run `task --list` to see all available tasks.
vars:
CORE_MODULES: .
CONTRIB_MODULES: >-
contrib/buildinfo-nethttp
contrib/buildinfo-slog
contrib/buildinfo-zap
contrib/buildinfo-otel
contrib/buildinfo-gin
contrib/buildinfo-chi
contrib/buildinfo-echo
contrib/buildinfo-fiber
tasks:
default:
desc: Show available tasks
cmds:
- task --list
test:
desc: Run all tests across all modules
cmds:
- go test ./...
test:race:
desc: Run all tests with the race detector
cmds:
- go test -race ./...
test:coverage:
desc: Run all tests with a 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"
vet:
desc: Run go vet across all modules
cmds:
- go vet ./...
lint:
desc: Run golangci-lint across all modules
cmds:
- golangci-lint run ./...
tidy:
desc: Run go mod tidy on every module in the repo
cmds:
- find . -name go.mod -execdir go mod tidy \;
zero-dep-check:
desc: Verify the core module has zero non-stdlib dependencies
cmds:
- |
if grep -E '^require\s+[^(]' go.mod | grep -v 'github.com/ubgo'; then
echo "buildinfo core has 3rd-party deps — forbidden"
exit 1
fi
echo "ok: zero non-stdlib deps in core"
build:
desc: Build all modules to ensure they compile
cmds:
- go build ./...
ci:
desc: Run the full local CI suite (vet + race tests + lint + zero-dep check)
cmds:
- task: vet
- task: test:race
- task: zero-dep-check
# - task: lint # uncomment once golangci-lint config is in place
clean:
desc: Remove build artifacts and coverage reports
cmds:
- rm -f cover.out cover.html