-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathTaskfile.yml
More file actions
97 lines (82 loc) · 2.61 KB
/
Copy pathTaskfile.yml
File metadata and controls
97 lines (82 loc) · 2.61 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
97
version: '3'
silent: true
env:
GOFLAGS: -buildvcs=false
vars:
DEV_TOOLS: docker run --rm -e GOFLAGS -v "$PWD:/app" -w /app dev-tools
tasks:
# ============================================================================
# MAIN COMMANDS
# ============================================================================
default:
cmds:
- task: info
- task: tidy
- task: fmt
- task: lint
- task: tests
- task: build
# ============================================================================
# INFORMATION
# ============================================================================
info:
cmds:
- echo "- Info"
- "{{.DEV_TOOLS}} go version"
# ============================================================================
# GO DEPENDENCIES MANAGEMENT
# ============================================================================
tidy:
cmds:
- echo "- Tidy"
- "{{.DEV_TOOLS}} go mod tidy"
dev-tools:build:
cmds:
- echo "- Building dev-tools image"
- docker build -t dev-tools -f ./tools/Dockerfile .
# ============================================================================
# DEVELOPMENT AND CODE QUALITY
# ============================================================================
fmt:
cmds:
- echo "- Format"
- task: lint:cmd
vars: { CLI_ARGS: "fmt ./..." }
- task: lint:cmd
vars: { CLI_ARGS: "run --fix --timeout=5m ./..." }
lint:
cmds:
- echo "- Lint"
- task: lint:cmd
vars: { CLI_ARGS: "run --timeout=5m ./..." }
lint:cmd:
cmds:
- "{{.DEV_TOOLS}} golangci-lint {{.CLI_ARGS}}"
security-scan:
cmds:
- echo "- Security scan"
- "{{.DEV_TOOLS}} go run golang.org/x/vuln/cmd/govulncheck@latest ./..."
vet:
desc: Static analysis via go vet.
cmds:
- echo "- go vet"
- "{{.DEV_TOOLS}} go vet ./..."
# ============================================================================
# TESTING
# ============================================================================
tests:
cmds:
- echo "- Tests"
- "{{.DEV_TOOLS}} go test -race ./..."
tests:short:
desc: Fast feedback loop — no race detector.
cmds:
- echo "- Tests (short, no -race)"
- "{{.DEV_TOOLS}} go test -short ./..."
# ============================================================================
# BUILD
# ============================================================================
build:
cmds:
- echo "- Build"
- "{{.DEV_TOOLS}} go build -o bin/flock-telegram ./cmd/flock-telegram"