-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
227 lines (193 loc) · 5.41 KB
/
Taskfile.yaml
File metadata and controls
227 lines (193 loc) · 5.41 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
version: "3"
vars:
SDK_DIR: ./sdk
MCP_DIR: ./mcp
DATEFIELD_DIR: ./datefield
VERSION:
sh: git describe --tags --always --dirty
tasks:
default:
desc: Show available tasks
cmds:
- task --list
# ---------------------------------------------------------------------------
# SDK
# ---------------------------------------------------------------------------
sdk:build:
desc: Build the SDK module
dir: "{{.SDK_DIR}}"
cmds:
- go build ./...
sdk:vet:
desc: Run go vet on the SDK module
dir: "{{.SDK_DIR}}"
cmds:
- go vet ./...
sdk:test:
desc: Run SDK tests
dir: "{{.SDK_DIR}}"
cmds:
- go test ./...
sdk:lint:
desc: Run golangci-lint on the SDK module
dir: "{{.SDK_DIR}}"
cmds:
- golangci-lint run ./...
sdk:fmt:
desc: Auto-fix formatting on the SDK module
dir: "{{.SDK_DIR}}"
cmds:
- go fmt ./...
sdk:check:
desc: Build, vet, lint, and test the SDK
cmds:
- task: sdk:build
- task: sdk:vet
- task: sdk:lint
- task: sdk:test
sdk:integration:
desc: Run SDK integration tests (requires Docker)
dir: "{{.SDK_DIR}}"
cmds:
- go test -tags integration -v -count=1 ./...
sdk:cover:
desc: Run SDK tests with coverage report (unit + integration)
dir: "{{.SDK_DIR}}"
cmds:
- go test -tags integration -v -count=1 -coverprofile=coverage.out -covermode=atomic -coverpkg=./... ./...
- go tool cover -func coverage.out
# ---------------------------------------------------------------------------
# TUI (root module)
# ---------------------------------------------------------------------------
tui:build:
desc: Build the TUI binary
cmds:
- go build -ldflags "-X main.version={{.VERSION}}" -o pbmate .
tui:vet:
desc: Run go vet on the TUI module
cmds:
- go vet ./...
tui:test:
desc: Run TUI tests
cmds:
- go test ./...
tui:lint:
desc: Run golangci-lint on the TUI module
cmds:
- golangci-lint run ./...
tui:fmt:
desc: Auto-fix formatting on the TUI module
cmds:
- go fmt ./...
tui:check:
desc: Build, vet, lint, and test the TUI
cmds:
- task: tui:build
- task: tui:vet
- task: tui:lint
- task: tui:test
tui:install:
desc: Install pbmate to $GOPATH/bin (runs check first)
deps:
- tui:check
cmds:
- go install -ldflags "-X main.version={{.VERSION}}" .
tui:image:
desc: Build production Docker image (host arch)
cmds:
- CGO_ENABLED=0 go build -ldflags "-s -w -X main.version={{.VERSION}}" -o pbmate_linux_$(go env GOARCH) .
- docker build -t pbmate:latest .
- rm -f pbmate_linux_*
tui:image:dev:
desc: Build Docker image from source (dev)
cmds:
- docker build -f Dockerfile.dev -t pbmate:dev .
# ---------------------------------------------------------------------------
# Datefield
# ---------------------------------------------------------------------------
datefield:build:
desc: Build the datefield module
dir: "{{.DATEFIELD_DIR}}"
cmds:
- go build ./...
datefield:vet:
desc: Run go vet on the datefield module
dir: "{{.DATEFIELD_DIR}}"
cmds:
- go vet ./...
datefield:test:
desc: Run datefield tests
dir: "{{.DATEFIELD_DIR}}"
cmds:
- go test ./...
datefield:lint:
desc: Run golangci-lint on the datefield module
dir: "{{.DATEFIELD_DIR}}"
cmds:
- golangci-lint run ./...
datefield:fmt:
desc: Auto-fix formatting on the datefield module
dir: "{{.DATEFIELD_DIR}}"
cmds:
- go fmt ./...
datefield:check:
desc: Build, vet, lint, and test the datefield module
cmds:
- task: datefield:build
- task: datefield:vet
- task: datefield:lint
- task: datefield:test
datefield:changelog:
desc: Generate datefield CHANGELOG.md from [datefield]-scoped commits
cmds:
- git cliff --config datefield/cliff.toml --output datefield/CHANGELOG.md
# ---------------------------------------------------------------------------
# Changelog
# ---------------------------------------------------------------------------
tui:changelog:
desc: Generate TUI CHANGELOG.md from [tui]-scoped commits
cmds:
- git cliff --config cliff.toml --output CHANGELOG.md
sdk:changelog:
desc: Generate SDK CHANGELOG.md from [sdk]-scoped commits
cmds:
- git cliff --config sdk/cliff.toml --output sdk/CHANGELOG.md
# ---------------------------------------------------------------------------
# All modules
# ---------------------------------------------------------------------------
build:
desc: Build all modules
cmds:
- task: sdk:build
- task: datefield:build
- task: tui:build
vet:
desc: Run go vet on all modules
cmds:
- task: sdk:vet
- task: datefield:vet
- task: tui:vet
test:
desc: Run tests for all modules
cmds:
- task: sdk:test
- task: datefield:test
- task: tui:test
lint:
desc: Run golangci-lint on all modules
cmds:
- task: sdk:lint
- task: datefield:lint
- task: tui:lint
fmt:
desc: Auto-fix formatting on all modules
cmds:
- task: sdk:fmt
- task: datefield:fmt
- task: tui:fmt
check:
desc: Build, vet, lint, and test all modules
cmds:
- task: sdk:check
- task: datefield:check
- task: tui:check