-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
197 lines (167 loc) · 4.6 KB
/
Taskfile.yml
File metadata and controls
197 lines (167 loc) · 4.6 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
version: "3"
vars:
BINARY: trindex
GO_VERSION: "1.26.0"
NODE_VERSION: "24"
tasks:
default:
desc: Build the Go binary (quick build, uses existing web assets)
cmds:
- go build -o {{.BINARY}} ./cmd/trindex
build:
desc: Build everything including web UI and embed assets
deps: [web:build]
cmds:
- go build -o {{.BINARY}} ./cmd/trindex
build:fast:
desc: Quick development build (no web rebuild)
cmds:
- go build -o {{.BINARY}} ./cmd/trindex
run:
desc: Run the application (requires Postgres)
deps: [build:fast]
cmds:
- ./{{.BINARY}}
dev:
desc: Quick development server
cmds:
- task: build:fast
- ./{{.BINARY}}
eval:
desc: Run the Cognitive Evaluation Suite using Testcontainers
env:
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock
cmds:
- DOCKER_HOST=$(docker context inspect | grep Host | cut -d '"' -f 4) go run ./cmd/trindex-eval {{.CLI_ARGS}}
test:
desc: Run all tests
cmds:
- go test -v ./...
test:short:
desc: Run tests (skip integration)
cmds:
- go test -v -short ./...
test:integration:
desc: Run integration tests with Docker
cmds:
- go test -v -tags=integration ./...
test:integration:ci:
desc: Run integration tests in CI mode
cmds:
- CI=true go test -v -tags=integration ./...
env:
TESTCONTAINERS_RYUK_DISABLED: "false"
TESTCONTAINERS_RYUK_CONNECTION_TIMEOUT: 5m
test:all:
desc: Run all tests (unit + integration)
cmds:
- task: test
- task: test:integration
colima:check:
desc: Verify Colima is running (macOS only)
platforms: [darwin]
cmds:
- |
if ! colima status 2>&1 | grep -qi "is running"; then
echo "❌ Colima is not running. Start it with: colima start --cpu 4 --memory 8"
exit 1
fi
echo "✅ Colima is running"
test:integration:mac:
desc: Run integration tests on macOS (checks Colima first)
platforms: [darwin]
deps: [colima:check]
cmds:
- |
export DOCKER_HOST="unix://${HOME}/.colima/default/docker.sock"
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE="/var/run/docker.sock"
go test -v -tags=integration ./...
clean:
desc: Clean build artifacts
cmds:
- rm -f {{.BINARY}}
- go clean
- rm -rf web/dist
- rm -rf internal/web/dist
lint:
desc: Run linter
cmds:
- golangci-lint run
fmt:
desc: Format code
cmds:
- go fmt ./...
deps:go:
desc: Download Go dependencies
cmds:
- go mod download
- go mod tidy
deps:node:
desc: Install Node.js dependencies
dir: web
cmds:
- npm ci
deps:
desc: Download all dependencies
deps: [deps:go, deps:node]
web:dev:
desc: Run web UI dev server
dir: web
cmds:
- npm run dev
web:build:
desc: Build web UI and copy to embedded location
dir: web
cmds:
- npm ci
- npm run build
- cp -r dist ../internal/web/
docker:build:
desc: Build Docker image
cmds:
- docker build -t {{.BINARY}} .
docker:up:
desc: Start Docker Compose services
cmds:
- docker compose up -d
docker:down:
desc: Stop Docker Compose services
cmds:
- docker compose down
install-hooks:
desc: Install git hooks
cmds:
- ./scripts/install-hooks.sh
check:
desc: Run all checks before commit
deps: [fmt, lint, test, build]
version:check:
desc: Check required versions
cmds:
- |
GO_VER=$(go version | grep -o 'go[0-9.]*' | head -1)
echo "Go version: $GO_VER (required: {{.GO_VERSION}})"
if [ "$GO_VER" != "go{{.GO_VERSION}}" ]; then
echo "⚠️ Warning: Go version mismatch. Expected {{.GO_VERSION}}"
fi
- |
NODE_VER=$(node --version | grep -o '[0-9]*' | head -1)
echo "Node version: $(node --version) (minimum: v{{.NODE_VERSION}})"
if [ "$NODE_VER" -lt "{{.NODE_VERSION}}" ]; then
echo "❌ Error: Node {{.NODE_VERSION}}+ required"
exit 1
fi
- echo "✅ All version requirements met"
release:dry:
desc: "Dry-run GoReleaser release"
cmds:
- goreleaser release --snapshot --clean
release:tag:
desc: "Create and push a release tag with version update (usage: task release:tag VERSION=v1.2.3)"
cmds:
- bash scripts/update-marketplace-version.sh {{.VERSION}}
- git add .claude-plugin/
- |
git commit -m "chore: bump version to {{.VERSION}}"
- git tag {{.VERSION}}
- git push origin main {{.VERSION}}