-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (39 loc) · 1.61 KB
/
Makefile
File metadata and controls
49 lines (39 loc) · 1.61 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
.PHONY: test test-unit test-live test-fuzz bench bench-update lint vuln tidy help
# Default target
help:
@echo "Common targets:"
@echo " make test -- run the full test suite with -race"
@echo " make test-unit -- run short unit tests only"
@echo " make test-live -- run the live ETag drift probe (needs GITHUB_TOKEN)"
@echo " make test-fuzz -- fuzz the ETag hash for 30 seconds"
@echo " make bench -- write benchmarks to dist/bench-current.txt"
@echo " make bench-update -- prompt to update docs/bench-baseline.txt manually"
@echo " make lint -- golangci-lint run"
@echo " make vuln -- govulncheck on the module"
@echo " make tidy -- go mod tidy with a diff gate"
@echo ""
@echo "Releases: lightweight tag + push (see Makefile footer)."
test:
go test -race ./...
test-unit:
go test -race -short ./...
test-live:
@[ -n "$$GITHUB_TOKEN" ] || { echo "GITHUB_TOKEN required"; exit 1; }
go test -tags=live -run TestETag_Live ./etag/...
test-fuzz:
go test -fuzz=FuzzETag_ComputeExpectedETag -fuzztime=30s ./etag/...
bench:
@mkdir -p dist
go test -bench=. -benchmem -run=^$$ ./... | tee dist/bench-current.txt
bench-update:
@echo "Review dist/bench-current.txt and copy manually to docs/bench-baseline.txt."
lint:
golangci-lint run
vuln:
# CI pins govulncheck via golang/govulncheck-action (Dependabot-tracked).
# This target is a local-dev fallback; it pulls whatever @latest is today.
# If you want a deterministic run locally, pin a specific version here.
go run golang.org/x/vuln/cmd/govulncheck@latest ./...
tidy:
go mod tidy
@git diff --exit-code go.mod go.sum