-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (32 loc) · 1.05 KB
/
Makefile
File metadata and controls
52 lines (32 loc) · 1.05 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
.PHONY: build test test-unit test-all cover cover-html bench lint fmt clean help
BINARY := go-git-commit-action
GOFLAGS := -v
## Build
build: ## Build the binary
go build $(GOFLAGS) -o $(BINARY) ./cmd/main.go
## Test
test: test-unit ## Run unit tests (alias)
test-unit: ## Run unit tests with coverage
go test ./internal/... ./cmd/... -v -cover
test-all: test-unit ## Run all tests
## Coverage
cover: ## Generate coverage report
go test ./internal/... ./cmd/... -coverprofile=coverage.out
go tool cover -func=coverage.out
cover-html: cover ## Open coverage report in browser
go tool cover -html=coverage.out
## Benchmark
bench: ## Run benchmarks
go test -bench=. -benchmem ./internal/...
## Quality
lint: ## Run go vet
go vet ./...
fmt: ## Format code
gofmt -s -w .
## Cleanup
clean: ## Remove build artifacts and coverage files
rm -f $(BINARY) coverage.out
## Help
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help