-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (77 loc) · 2.74 KB
/
Makefile
File metadata and controls
97 lines (77 loc) · 2.74 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
# GENEALOGIX Makefile
.PHONY: help build build-cli build-website install-deps lint lint-fix test test-verbose test-race test-coverage bench mod-tidy mod-verify clean fmt check-schemas check-links release-snapshot
.DEFAULT_GOAL := help
## Help
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}'
## Dependencies
install-deps: ## Install Go modules and npm packages
@echo "Installing Go dependencies..."
go mod download
@echo "Installing website dependencies..."
cd website && npm install
## Build
build-cli: ## Build the glx binary to bin/
@mkdir -p bin
go build -o bin/glx ./glx
build-website: ## Build the documentation site
@echo "Building website..."
cd website && npm run build
build: build-cli build-website ## Build CLI and website
## Code Quality
fmt: ## Format Go and website code
@echo "Formatting Go code..."
golangci-lint fmt
@echo "Formatting website..."
cd website && npm run format
lint: ## Run linters (Go + website)
@echo "Linting Go code..."
golangci-lint run ./...
@echo "Linting website..."
cd website && npm run lint
lint-fix: ## Run linters with automatic fixes
@echo "Fixing Go code..."
golangci-lint run --fix ./...
@echo "Fixing website..."
cd website && npm run lint:fix
## Testing
test: ## Run all tests
go test -timeout 10m ./...
test-verbose: ## Run all tests with verbose output
go test -v -timeout 10m ./...
bench: ## Run benchmarks
go test -bench=. -benchmem -count=6 -run='^$$' -timeout 10m ./glx/... ./go-glx/... > bench.txt
@cat bench.txt
test-race: ## Run tests with race detector
CGO_ENABLED=1 go test -race -timeout 15m ./...
test-coverage: ## Run tests with coverage report
@echo "Running tests with coverage..."
@mkdir -p coverage
go test -timeout 10m -coverprofile=coverage/coverage.out ./...
@echo "Generating HTML coverage report..."
go tool cover -html=coverage/coverage.out -o coverage/coverage.html
@echo "Coverage report generated at coverage/coverage.html"
@echo "Opening coverage report in browser..."
@go tool cover -func=coverage/coverage.out | tail -n 1
## Module Management
mod-tidy: ## Tidy Go module dependencies
go mod tidy
@echo "go.mod and go.sum are tidy"
mod-verify: ## Verify Go module integrity
go mod verify
## Specification
check-schemas: ## Validate JSON schema files
@node specification/validate-schemas.mjs
## Release
release-snapshot: ## Build cross-platform binaries locally (no publish)
goreleaser release --snapshot --clean
## Link Checking
check-links: ## Validate internal markdown links
@bash scripts/check-links.sh
## Cleanup
clean: ## Remove build artifacts
rm -rf bin
rm -rf coverage
rm -rf dist
rm -rf website/.vitepress/dist
rm -rf website/.vitepress/cache