-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (48 loc) · 2.22 KB
/
Copy pathMakefile
File metadata and controls
60 lines (48 loc) · 2.22 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
.PHONY: build test fmt fmt-check vet lint ci smoke contract-check check-skills hook-env-check
GO_FILES := $(shell find . -name '*.go' -not -path './vendor/*')
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
# GoReleaser {{.Version}} is bare semver; strip one leading v from VERSION.
EMBED_VERSION := $(patsubst v%,%,$(VERSION))
GOLANGCI_LINT_CACHE ?= $(CURDIR)/.golangci-cache
build:
go build -ldflags "-X main.version=$(EMBED_VERSION)" -o amq ./cmd/amq
go build -ldflags "-X main.version=$(EMBED_VERSION)" -o amq-keepalive ./cmd/amq-keepalive
go build -ldflags "-X main.version=$(EMBED_VERSION)" -o amq-bridge ./cmd/amq-bridge
go build -ldflags "-X main.version=$(EMBED_VERSION)" -o amq-acp ./cmd/amq-acp
test:
go test ./...
fmt:
gofmt -w $(GO_FILES)
fmt-check:
@test -z "$(shell gofmt -l $(GO_FILES))"
vet:
go vet ./...
lint:
@command -v golangci-lint >/dev/null 2>&1 || { echo "golangci-lint not installed. Install from https://golangci-lint.run/usage/install/"; exit 1; }
GOLANGCI_LINT_CACHE="$(GOLANGCI_LINT_CACHE)" golangci-lint run
# Keep this hostile AMQ context tuple aligned with smoke-test.sh's startup scrub.
smoke:
AM_ROOT=/smoke/inherited/root \
AM_ROOT_ID=smoke-inherited-root-id \
AM_ME=smoke-caller \
AM_BASE_ROOT=/smoke/inherited/base \
AM_BASE_ROOT_ID=smoke-inherited-base-root-id \
AM_SESSION=smoke-session \
AMQ_GLOBAL_ROOT=/smoke/inherited/global \
AMQ_WAKE_OWNER=smoke-inherited-wake-owner \
./scripts/smoke-test.sh
ci: check-skills fmt-check vet lint test smoke contract-check hook-env-check
hook-env-check:
@sh scripts/test_pre_push_hook_env.sh
contract-check:
@sh scripts/probe-codex-app-execute-javascript_test.sh
@bash scripts/check-keepalive-amq-contract_test.sh
@candidate_dir="$$(mktemp -d "$${TMPDIR:-/tmp}/amq-keepalive-candidate.XXXXXX")"; \
trap 'rm -rf "$$candidate_dir"' EXIT; \
go build -o "$$candidate_dir/amq" ./cmd/amq; \
bash scripts/check-keepalive-amq-contract.sh "$$candidate_dir/amq"
# Skill integrity: skills/ is canonical; .claude, .agents, and .grok skills are symlinks.
# The negative fixture must run first so a fail-open checker cannot hide behind a later live pass.
check-skills:
@bash scripts/test_check_skills.sh
@bash scripts/check-skills.sh