-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
91 lines (76 loc) · 1.77 KB
/
Taskfile.yml
File metadata and controls
91 lines (76 loc) · 1.77 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
version: "3"
vars:
BINARY: pen
MAIN: ./cmd/pen
COVERAGE_FILE: coverage.txt
tasks:
default:
desc: Show available tasks
cmds:
- task --list
build:
desc: Build the binary
cmds:
- go build -trimpath -o {{.BINARY}} {{.MAIN}}
sources:
- "**/*.go"
- go.mod
- go.sum
generates:
- "{{.BINARY}}"
test:
desc: Run all tests with race detector
cmds:
- go test -race -count=1 ./...
coverage:
desc: Run tests with coverage report
cmds:
- go test -race -coverprofile={{.COVERAGE_FILE}} -count=1 ./...
- go tool cover -func={{.COVERAGE_FILE}}
coverage:html:
desc: Generate HTML coverage report
cmds:
- go test -race -coverprofile={{.COVERAGE_FILE}} -count=1 ./...
- go tool cover -html={{.COVERAGE_FILE}} -o coverage.html
vet:
desc: Run go vet
cmds:
- go vet ./...
lint:
desc: Run golangci-lint
cmds:
- golangci-lint run --timeout=5m
lint:fix:
desc: Run golangci-lint with auto-fix
cmds:
- golangci-lint run --fix --timeout=5m
vulncheck:
desc: Run govulncheck for known vulnerabilities
cmds:
- govulncheck ./...
tidy:
desc: Tidy and verify go modules
cmds:
- go mod tidy
- go mod verify
check:
desc: Run all checks (vet, lint, vulncheck, test)
cmds:
- task: vet
- task: lint
- task: vulncheck
- task: test
release:dry:
desc: Dry-run GoReleaser (snapshot)
cmds:
- goreleaser release --snapshot --clean
release:check:
desc: Validate GoReleaser config
cmds:
- goreleaser check
clean:
desc: Remove build artifacts
cmds:
- rm -f {{.BINARY}} {{.BINARY}}.exe
- rm -f {{.COVERAGE_FILE}} coverage.html
- rm -rf dist/