2026-02-28 15:01:20 +08:00
|
|
|
.PHONY: build generate test test-unit test-integration test-e2e
|
|
|
|
|
|
|
|
|
|
VERSION ?= $(shell tr -d '\r\n' < ./cmd/server/VERSION)
|
|
|
|
|
LDFLAGS ?= -s -w -X main.Version=$(VERSION)
|
2025-12-30 16:41:45 +08:00
|
|
|
|
|
|
|
|
build:
|
2026-02-28 15:01:20 +08:00
|
|
|
CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -trimpath -o bin/server ./cmd/server
|
|
|
|
|
|
|
|
|
|
generate:
|
|
|
|
|
go generate ./ent
|
|
|
|
|
go generate ./cmd/server
|
2025-12-30 16:41:45 +08:00
|
|
|
|
2026-01-05 13:54:43 +08:00
|
|
|
test:
|
|
|
|
|
go test ./...
|
|
|
|
|
golangci-lint run ./...
|
|
|
|
|
|
2025-12-30 16:41:45 +08:00
|
|
|
test-unit:
|
|
|
|
|
go test -tags=unit ./...
|
|
|
|
|
|
|
|
|
|
test-integration:
|
|
|
|
|
go test -tags=integration ./...
|
|
|
|
|
|
|
|
|
|
test-e2e:
|
2026-02-08 12:05:39 +08:00
|
|
|
./scripts/e2e-test.sh
|
|
|
|
|
|
|
|
|
|
test-e2e-local:
|
|
|
|
|
go test -tags=e2e -v -timeout=300s ./internal/integration/...
|