-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (57 loc) · 2.18 KB
/
Makefile
File metadata and controls
73 lines (57 loc) · 2.18 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
# Makefile for workflow project
.PHONY: test lint vuln build examples clean help docs
# Default target
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
test: ## Run tests with coverage
go test -race -count=1 -shuffle=on -timeout=10m -coverprofile=coverage.out -covermode=atomic ./...
go tool cover -html=coverage.out -o coverage.html
lint: ## Run golangci-lint
golangci-lint run ./...
vuln: ## Run govulncheck
go run golang.org/x/vuln/cmd/govulncheck@latest ./...
build: ## Build the project
go build ./...
examples: ## Run all examples
@echo "Running basic example..."
@cd examples/basic && go run main.go
@echo "\n\nRunning CI/CD example..."
@cd examples/cicd && go run main.go
@echo "\n\nRunning advanced example..."
@cd examples/advanced && go run main.go
@echo "\n\nRunning middleware example..."
@cd examples/middleware && go run main.go
tidy: ## Run go mod tidy on all modules
go mod tidy
cd examples/basic && go mod tidy
cd examples/cicd && go mod tidy
cd examples/advanced && go mod tidy
cd examples/middleware && go mod tidy
clean: ## Clean build artifacts
go clean ./...
rm -f coverage.out coverage.html
rm -f examples/advanced/results.json
fmt: ## Format code
go fmt ./...
goimports -w .
gofmt -s -w .
check: lint vuln test ## Run all checks (lint + vuln + test)
docs: ## Generate documentation
gomarkdoc --output docs/llms.md .
@echo "Documentation available at:"
@echo " - README.md (main documentation)"
@echo " - docs/architecture.md (architecture overview)"
@echo " - docs/best-practices.md (best practices guide)"
@echo " - examples/ (working examples)"
@echo " - docs/llms.md (generated API documentation for LLMs)"
install-tools: ## Install development tools
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/stacklok/frizbee@latest
go install github.com/princjef/gomarkdoc/cmd/gomarkdoc@latest
pin-actions: ## pin github actions
go tool github.com/stacklok/frizbee actions .github/workflows
ci: tidy fmt lint vuln test ## Run CI pipeline locally
.DEFAULT_GOAL := help