forked from bojieli/agentreach
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (53 loc) · 2.47 KB
/
Copy pathMakefile
File metadata and controls
69 lines (53 loc) · 2.47 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
# AgentReach — agent hands on remote hosts
GO ?= go
BIN := reach
VERSION := $(shell sed -n 's/.*Version = "\(.*\)".*/\1/p' internal/reach/types.go)
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
# The commit's own date rather than the wall clock, so two builds of the same
# commit produce identical binaries.
DATE := $(shell git log -1 --format=%cd --date=format:%Y-%m-%d 2>/dev/null || echo unknown)
LDFLAGS := -s -w \
-X main.buildVersion=$(VERSION) \
-X main.buildCommit=$(COMMIT) \
-X main.buildDate=$(DATE)
.PHONY: all build build-helper test vet lint e2e mock conformance integration bench clean install fmt check
all: check build
build: ## build the reach binary
$(GO) build -ldflags '$(LDFLAGS)' -o $(BIN) ./cmd/reach
# The helper binary for this platform. reach finds it beside its own binary, so
# installing both means the agent tier works against a same-platform target
# without a cross-compile. Other platforms are cross-built on demand.
build-helper: ## build the optional helper binary for this platform
$(GO) build -trimpath -ldflags '-s -w -X main.version=$(VERSION)' \
-o $(BIN)-helper ./cmd/reach-helper
install: build build-helper ## install to ~/.local/bin
install -d $(HOME)/.local/bin
install -m 0755 $(BIN) $(HOME)/.local/bin/$(BIN)
install -m 0755 $(BIN)-helper $(HOME)/.local/bin/$(BIN)-helper
@echo "installed $(HOME)/.local/bin/$(BIN)"
test: ## unit and integration tests (no model tokens spent)
$(GO) test -race -count=1 ./...
vet:
$(GO) vet ./...
lint: ## golangci-lint, the same configuration CI uses
@command -v golangci-lint >/dev/null || { \
echo "golangci-lint is not installed:"; \
echo " go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2"; \
exit 1; }
golangci-lint run ./...
fmt:
$(GO) fmt ./...
check: vet test ## everything that runs without a network or an API key
e2e: build ## end-to-end tests against real agents (SPENDS MODEL TOKENS)
./test/e2e/transparency_test.sh
mock: ## verify the mock model server (no API key, no tokens)
./test/e2e/mockmodel_test.sh
conformance: build ## verify harness seams still have the shape reach expects
./test/e2e/conformance_test.sh
integration: ## file-operation tiers against a real sshd (no network, no API key)
$(GO) test -race -count=1 -tags integration ./test/integration/...
bench: ## measure what each file-operation tier costs (docs/TRANSPORTS.md)
./test/bench/tiers_bench.sh
clean:
rm -f $(BIN) $(BIN)-helper
$(GO) clean -testcache