-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (43 loc) · 1.58 KB
/
Makefile
File metadata and controls
59 lines (43 loc) · 1.58 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
BINARY := a7
MODULE := github.com/api7/a7
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
DATE := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
LDFLAGS := -s -w \
-X $(MODULE)/internal/version.Version=$(VERSION) \
-X $(MODULE)/internal/version.Commit=$(COMMIT) \
-X $(MODULE)/internal/version.Date=$(DATE)
.PHONY: build test test-verbose lint fmt vet check install clean docker-up docker-down validate-skills test-skills test-e2e test-e2e-full
build:
go build -ldflags "$(LDFLAGS)" -o bin/$(BINARY) ./cmd/a7
test:
go test ./... -count=1
test-verbose:
go test ./... -count=1 -v
lint:
golangci-lint run ./...
fmt:
gofmt -w .
goimports -w .
vet:
go vet ./...
check: fmt vet lint test validate-skills test-skills
validate-skills:
bash ./scripts/validate-skills.sh
test-skills:
go test ./test/e2e/skills -tags=e2e -count=1
install: build
cp bin/$(BINARY) $(GOPATH)/bin/$(BINARY)
clean:
rm -rf bin/
docker-up:
docker compose -f test/e2e/docker-compose.yml up -d --wait --wait-timeout 120
docker-down:
docker compose -f test/e2e/docker-compose.yml down -v
# test-e2e and test-e2e-full intentionally share the same Ginkgo entrypoint.
# The default CI stays narrower via runtime guards such as requireGatewayURL,
# requireHTTPBin, and A7_E2E_ENABLE_GATEWAY_GROUP_CRUD.
test-e2e:
go run github.com/onsi/ginkgo/v2/ginkgo -r --procs=1 --tags=e2e --timeout=45m ./test/e2e/...
test-e2e-full:
go run github.com/onsi/ginkgo/v2/ginkgo -r --procs=1 --tags=e2e --timeout=45m ./test/e2e/...