-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (48 loc) · 1.52 KB
/
Makefile
File metadata and controls
65 lines (48 loc) · 1.52 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
.PHONY: build test test-unit test-integration test-e2e test-all test-coverage test-ollama check-cve lint vet e2e clean sandbox-run sandbox-log
build:
go build -ldflags "-X github.com/dimetron/pi-go/internal/cli.BuildTag=$$(git rev-parse --short HEAD 2>/dev/null || echo local)" ./cmd/pi
go build ./cmd/pi-sandbox
install: build
go install ./cmd/pi/
go install ./cmd/pi-sandbox
run: install
pi --model minimax-m2.7:cloud
test: test-unit
test-unit:
go test ./...
test-integration:
go test -tags integration ./...
test-e2e:
go test -tags e2e ./...
# keep old name as alias
e2e: test-e2e
test-all: test-unit test-integration test-e2e
test-coverage:
go test -coverprofile=coverage.out -coverpkg=./internal/... ./internal/... && go tool cover -func=coverage.out | tail -1
test-ollama: build
@bash scripts/test-ollama-e2e.sh
check-cve:
go mod tidy -v
grype db update || :
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./... | grep -A7 Vulnerability || :
grype .
lint:
golangci-lint run ./...
vet:
go vet ./...
clean:
rm -f pi coverage.out
## OSX sandbox — pi-sandbox embeds pi-profile.sb, resolves params, tails denial logs automatically
sandbox-run: install
ifeq ($(shell uname),Darwin)
pi-sandbox --model minimax-m2.7:cloud
else
pi --model minimax-m2.7:cloud
endif
sandbox-log:
ifeq ($(shell uname),Darwin)
/usr/bin/log show --predicate 'eventMessage CONTAINS "sandbox" AND eventMessage CONTAINS "deny"' --last $(or $(LAST),1m) --style compact
else
@echo "sandbox-log is only available on macOS"
endif