-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
109 lines (93 loc) · 3.45 KB
/
Makefile
File metadata and controls
109 lines (93 loc) · 3.45 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
98
99
100
101
102
103
104
105
106
107
108
109
.PHONY: help build test test-e2e test-smoke test-integration test-claude-cli lint clean coverage install release snapshot
# Version information
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
# Build flags
LDFLAGS := -s -w \
-X main.version=$(VERSION) \
-X main.commit=$(COMMIT) \
-X main.buildDate=$(BUILD_DATE)
# Installation directory
INSTALL_DIR ?= /usr/local/bin
help:
@echo "Available targets:"
@echo " build - Build the conductor binary"
@echo " test - Run all tests (unit + E2E)"
@echo " test-e2e - Run E2E tests with mocked providers"
@echo " test-smoke - Run smoke tests with real providers (Ollama/Anthropic)"
@echo " test-integration - Run integration tests (require external services)"
@echo " test-claude-cli - Run Claude Code CLI integration tests"
@echo " lint - Run golangci-lint"
@echo " clean - Clean build artifacts"
@echo " coverage - Generate test coverage report"
@echo " install - Install conductor binary to $(INSTALL_DIR)"
@echo " release - Create a new release with GoReleaser"
@echo " snapshot - Build snapshot release (no publish)"
@echo ""
@echo "Variables:"
@echo " VERSION=$(VERSION)"
@echo " COMMIT=$(COMMIT)"
@echo " BUILD_DATE=$(BUILD_DATE)"
build:
@echo "Building conductor $(VERSION)..."
go build -ldflags="$(LDFLAGS)" -o bin/conductor ./cmd/conductor
test:
@echo "Running unit tests..."
@go test -v -race ./... -short
@echo ""
@echo "Running E2E tests with mocked providers..."
@$(MAKE) test-e2e
test-e2e:
@echo "Running E2E tests (mock providers, no external dependencies)..."
go test -v -race ./test/e2e/...
test-smoke:
@echo "Running smoke tests with real providers..."
@echo "Note: Requires Ollama running locally OR ANTHROPIC_API_KEY set"
@echo ""
go test -v -tags=smoke ./test/e2e/...
test-integration:
go test -v -race -tags=integration ./...
test-claude-cli:
@command -v claude >/dev/null 2>&1 || command -v claude-code >/dev/null 2>&1 || { \
echo "Error: Claude CLI not found. Install Claude Code to run these tests."; \
exit 1; \
}
CONDUCTOR_CLAUDE_CLI=1 go test -v -tags=integration ./pkg/llm/providers/claudecode/...
lint:
golangci-lint run
clean:
rm -f conductor
rm -rf bin/
rm -rf dist/
go clean -cache -testcache
coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report generated: coverage.html"
install: build
@echo "Installing conductor to $(INSTALL_DIR)..."
@if [ -w "$(INSTALL_DIR)" ]; then \
install -m 755 bin/conductor $(INSTALL_DIR)/conductor; \
else \
echo "$(INSTALL_DIR) is not writable, using sudo..."; \
sudo install -m 755 bin/conductor $(INSTALL_DIR)/conductor; \
fi
@echo "Conductor installed successfully!"
@echo "Run 'conductor version' to verify installation"
release:
@if [ -z "$(shell which goreleaser)" ]; then \
echo "Error: goreleaser not found"; \
echo "Install it from: https://goreleaser.com/install/"; \
exit 1; \
fi
@echo "Creating release $(VERSION)..."
goreleaser release --clean
snapshot:
@if [ -z "$(shell which goreleaser)" ]; then \
echo "Error: goreleaser not found"; \
echo "Install it from: https://goreleaser.com/install/"; \
exit 1; \
fi
@echo "Building snapshot release..."
goreleaser release --snapshot --clean