-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (58 loc) · 2.08 KB
/
Copy pathMakefile
File metadata and controls
73 lines (58 loc) · 2.08 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
.PHONY: help clean build lint test test-race fuzz-smoke runtime simulator harness-admission harness-full install
BIN_DIR ?= bin
RUNTIME_AGENT := $(word 2,$(MAKECMDGOALS))
help:
@printf '%s\n' \
'Common targets:' \
' make build' \
' make lint' \
' make test' \
' make test-race' \
' make fuzz-smoke' \
' make runtime simulator' \
' make runtime <registry-agent-id>' \
' ./run openai-server --agent <registry-agent-id>' \
' make harness-admission' \
' make clean'
clean:
rm -rf $(BIN_DIR) .tmp harness-outputs acp-runtime acp-openai-server acp-simulator-agent acp-harness
build:
mkdir -p $(BIN_DIR)
go build -o $(BIN_DIR)/acp-runtime ./cmd/acp-runtime
go build -o $(BIN_DIR)/acp-openai-server ./cmd/acp-openai-server
go build -o $(BIN_DIR)/acp-simulator-agent ./cmd/acp-simulator-agent
go build -o $(BIN_DIR)/acp-harness ./cmd/acp-harness
lint:
go vet ./...
test:
go test ./...
test-race:
go test -race ./...
bench:
go test -run '^$$' -bench='BenchmarkPeer|BenchmarkEmit|BenchmarkHandle|BenchmarkFinish|BenchmarkSnapshot|BenchmarkThread|BenchmarkSession' -benchmem -count=3 -timeout 180s .
fuzz-smoke:
go test -run '^$$' -fuzz=FuzzParseRPCMessage -fuzztime=2s .
runtime: build
@if [ -z "$(RUNTIME_AGENT)" ]; then \
echo 'usage: make runtime <agent-id>'; \
exit 2; \
fi
$(BIN_DIR)/acp-runtime "$(RUNTIME_AGENT)"
simulator:
@:
harness-admission: build
$(BIN_DIR)/acp-harness --case harness/cases/05-session-prompt.json --simulator-bin $(BIN_DIR)/acp-simulator-agent
harness-full: build
@for case_file in harness/cases/*.json; do \
$(BIN_DIR)/acp-harness --case "$$case_file" --simulator-bin $(BIN_DIR)/acp-simulator-agent || exit $$?; \
done
install: build
install -m 0755 $(BIN_DIR)/acp-runtime /usr/local/bin/acp-runtime
install -m 0755 $(BIN_DIR)/acp-openai-server /usr/local/bin/acp-openai-server
install -m 0755 $(BIN_DIR)/acp-simulator-agent /usr/local/bin/acp-simulator-agent
install -m 0755 $(BIN_DIR)/acp-harness /usr/local/bin/acp-harness
%:
@if [ "$@" = "$(firstword $(MAKECMDGOALS))" ]; then \
echo "Unknown target: $@"; \
exit 2; \
fi