-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (33 loc) · 1.33 KB
/
Makefile
File metadata and controls
43 lines (33 loc) · 1.33 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
.PHONY: build test test-race test-stress clean lint help
BINARY := multiarc-plugin
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
build: ## Build the plugin binary
@echo "Building $(BINARY) $(VERSION)..."
@CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=$(VERSION)" -o $(BINARY) .
@echo "Done: $(BINARY)"
test: ## Run integration tests
@echo "Running integration tests..."
@cd tests && go run test_v2.go
test-stress: ## Run stress and edge case tests
@echo "Running stress tests..."
@cd tests && go run test_stress.go
test-race: ## Run all tests with race detector
@echo "Running tests with race detector..."
@cd tests && go run -race test_v2.go
@cd tests && go run -race test_stress.go
test-all: test test-stress ## Run all tests
lint: ## Run go vet and go fmt
@echo "Linting..."
@go vet ./...
@go fmt ./...
@echo "Lint passed."
clean: ## Remove build artifacts
@echo "Cleaning..."
@rm -f $(BINARY)
@rm -rf /tmp/.opencode-multiarc*
@echo "Done."
install: build ## Build and install to GOPATH/bin
@cp $(BINARY) $(GOPATH)/bin/$(BINARY) 2>/dev/null || cp $(BINARY) ~/go/bin/$(BINARY)
@echo "Installed to $(GOPATH)/bin/$(BINARY)"