-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yml
More file actions
80 lines (68 loc) · 1.79 KB
/
Taskfile.yml
File metadata and controls
80 lines (68 loc) · 1.79 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
version: '3'
env:
DATA_DIR: ./data
vars:
BINARY_NAME: protodex
BUILD_DIR: bin
tasks:
default:
desc: Protodex Taskfile
cmds:
- task --list
build:frontend:
desc: Build React frontend
dir: web
cmds:
- npm install
- npm run build
sources:
- "web/src/**/*"
- "web/package.json"
- "web/package-lock.json"
generates:
- "internal/server/web/dist/**/*"
build:
desc: Build the protodex binary with embedded frontend
deps: [build:frontend]
cmds:
- go build -o {{.BUILD_DIR}}/{{.BINARY_NAME}} ./cmd/{{.BINARY_NAME}}
- echo '✅ Build successful! Binary located at {{.BUILD_DIR}}/{{.BINARY_NAME}}'
build:go:
desc: Build protodex without downloading protoc
cmds:
- go build -o {{.BUILD_DIR}}/{{.BINARY_NAME}} ./cmd/{{.BINARY_NAME}}
serve:
desc: Run the protodex server
cmds:
- "./{{.BUILD_DIR}}/{{.BINARY_NAME}} serve --data-dir {{.DATA_DIR}}"
clean:
desc: Clean build artifacts
cmds:
- rm -rf {{.BUILD_DIR}}
- rm -f coverage.out coverage.html
test:
desc: Run Go tests
cmds:
- go test -v ./...
test:coverage:
desc: Run Go tests with coverage
cmds:
- go test -v -coverprofile={{.BUILD_DIR}}/coverage.out ./...
- go tool cover -html=coverage.out -o {{.BUILD_DIR}}/coverage.html
- echo 'Coverage report generated at {{.BUILD_DIR}}/coverage.html'
lint:
desc: Run Go linter
cmds:
- go fmt ./...
- go vet ./...
- golangci-lint run
format:
desc: Format Go code
cmds:
- go fmt ./...
- goimports -w -local github.com/sirrobot01/protodex .
pre-commit:
desc: Run pre-commit checks
deps: [format, lint, test:coverage]
cmds:
- echo '✅ All pre-commit checks passed!'