-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (52 loc) · 2.17 KB
/
Makefile
File metadata and controls
67 lines (52 loc) · 2.17 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
# Containers - A generic, reusable Go module for container orchestration, health checking, lifecycle management, and service discovery. Supports Docker, Podman, and Kubernetes runtimes.
# Module: digital.vasic.containers
.PHONY: build test test-race test-short test-integration test-bench test-coverage fmt vet lint clean help
MODULE := digital.vasic.containers
GOMAXPROCS ?= 2
build:
go build ./...
test:
GOMAXPROCS=$(GOMAXPROCS) go test -count=1 -race -p 1 ./...
test-race:
GOMAXPROCS=$(GOMAXPROCS) go test -count=1 -race -p 1 ./...
test-short:
GOMAXPROCS=$(GOMAXPROCS) go test -count=1 -short -p 1 ./...
test-integration:
GOMAXPROCS=$(GOMAXPROCS) go test -count=1 -race -p 1 ./tests/integration/... 2>/dev/null || echo "No integration tests"
test-bench:
GOMAXPROCS=$(GOMAXPROCS) go test -bench=. -benchmem ./tests/benchmark/... 2>/dev/null || echo "No benchmarks"
test-coverage:
GOMAXPROCS=$(GOMAXPROCS) go test -count=1 -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
fmt:
gofmt -w .
goimports -w .
vet:
go vet ./...
lint:
@command -v golangci-lint >/dev/null 2>&1 || { echo "golangci-lint not installed"; exit 1; }
golangci-lint run ./...
clean:
rm -f coverage.out coverage.html
go clean -cache
# Challenges (run from parent HelixAgent project)
challenge:
../challenges/scripts/containers_challenge.sh 2>/dev/null || echo "No challenge script"
help:
@echo "Containers - A generic, reusable Go module for container orchestration, health checking, lifecycle management, and service discovery. Supports Docker, Podman, and Kubernetes runtimes."
@echo ""
@echo "Build & Test:"
@echo " make build Build all packages"
@echo " make test Run all tests with race detection"
@echo " make test-short Run unit tests only"
@echo " make test-bench Run benchmarks"
@echo " make test-coverage Generate coverage report"
@echo ""
@echo "Quality:"
@echo " make fmt Format code"
@echo " make vet Run go vet"
@echo " make lint Run golangci-lint"
@echo ""
@echo "Other:"
@echo " make clean Remove build artifacts"
@echo " make challenge Run challenge script (from parent project)"