-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (27 loc) · 1.27 KB
/
Copy pathMakefile
File metadata and controls
41 lines (27 loc) · 1.27 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
.DEFAULT_GOAL := help
BINARY := ember
CMD := ./cmd/ember
LDFLAGS := -s -w
GO_TEST_FLAGS := -race -shuffle=on -count=1
.PHONY: build test test-nocolor lint bench check integration integration-docker fuzz clean help
build: ## Build the binary
go build -ldflags="$(LDFLAGS)" -o $(BINARY) $(CMD)
test: ## Run tests with race detector, shuffle and no cache
go test ./... $(GO_TEST_FLAGS)
test-nocolor: ## Run UI tests under NO_COLOR=1
NO_COLOR=1 go test ./internal/ui/... $(GO_TEST_FLAGS)
lint: ## Run golangci-lint
golangci-lint run
bench: ## Run benchmarks
go test -bench=. -benchmem ./internal/app/
integration: ## Run integration tests (requires running Caddy)
go test -tags integration $(GO_TEST_FLAGS) -v ./internal/app/
integration-docker: ## Run multi-Caddy smoke test (requires Docker)
go test -tags integration_docker $(GO_TEST_FLAGS) -v -run MultiCaddySmoke ./internal/app/
fuzz: ## Run all fuzz targets for 30s each
./scripts/run_fuzz.sh 30s
check: lint test test-nocolor ## Run lint + tests + NO_COLOR variant
clean: ## Remove build artifacts
rm -f $(BINARY) coverage.txt integration-coverage.txt
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'