-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yml
More file actions
89 lines (74 loc) · 1.81 KB
/
Taskfile.yml
File metadata and controls
89 lines (74 loc) · 1.81 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
version: '3'
vars:
BINARY: sog
MAIN: ./cmd/sog
tasks:
default:
desc: Show available tasks
cmds:
- task --list
build:
desc: Build the binary
cmds:
- go build -o {{.BINARY}} {{.MAIN}}
install:
desc: Install to $GOPATH/bin
cmds:
- go install {{.MAIN}}
fmt:
desc: Format code
cmds:
- gofmt -s -w .
- goimports -w .
lint:
desc: Run linters
cmds:
- go vet ./...
- staticcheck ./... || true
test:
desc: Run tests
cmds:
- go test -v ./...
test:coverage:
desc: Run unit tests with coverage
cmds:
- go test -coverprofile=coverage.out ./...
- go tool cover -func=coverage.out
- go tool cover -html=coverage.out -o coverage.html
test:integration:
desc: Run integration tests (requires GreenMail)
cmds:
- go test -tags=integration -v ./...
test:all:
desc: Run all tests with coverage (target ≥85%)
cmds:
- go test -tags=integration -coverprofile=coverage.out ./...
- go tool cover -func=coverage.out
- go tool cover -html=coverage.out -o coverage.html
quality:
desc: Run all quality checks
cmds:
- task: fmt
- task: lint
- task: test
check:
desc: Pre-commit checks (fmt + lint + test)
cmds:
- task: quality
clean:
desc: Clean build artifacts
cmds:
- rm -f {{.BINARY}} coverage.out coverage.html
deps:
desc: Download and tidy dependencies
cmds:
- go mod download
- go mod tidy
completions:
desc: Generate shell completions
cmds:
- mkdir -p completions
- ./sog --help-man > completions/sog.1 2>/dev/null || true
- echo "# Bash: source completions/sog.bash"
- echo "# Zsh: source completions/sog.zsh"
- echo "# Fish: source completions/sog.fish"