* feat(gateway): 升级 SDK 并封口兼容合同 * fix: 修正升级后的格式与模型过滤 * fix(ci): 更新 Go 漏洞扫描器 * fix(gateway): 拒绝非标准服务层级字段
47 lines
1.2 KiB
Makefile
47 lines
1.2 KiB
Makefile
.DEFAULT_GOAL := help
|
|
|
|
APP := gpt-load
|
|
WEB_DIR := web
|
|
GO ?= go
|
|
PNPM ?= corepack pnpm
|
|
|
|
.PHONY: _web-deps
|
|
_web-deps:
|
|
$(PNPM) --dir $(WEB_DIR) install --frozen-lockfile
|
|
|
|
.PHONY: _web-build
|
|
_web-build: _web-deps
|
|
$(PNPM) --dir $(WEB_DIR) run build
|
|
|
|
.PHONY: dev
|
|
dev: _web-build ## Build the Web UI and run with race detection
|
|
$(GO) run -race .
|
|
|
|
.PHONY: run
|
|
run: _web-build ## Build the Web UI and run the application
|
|
$(GO) run .
|
|
|
|
.PHONY: build
|
|
build: _web-build ## Build the Web UI and application binary
|
|
$(GO) build -o $(APP) .
|
|
|
|
.PHONY: test
|
|
test: ## Run Go unit tests
|
|
$(GO) test -count=1 . ./internal/...
|
|
|
|
.PHONY: check
|
|
check: _web-deps ## Run source checks and build
|
|
@go_root="$$($(GO) env GOROOT)"; formatted_files="$$("$${go_root}/bin/gofmt" -l .)"; test -z "$${formatted_files}"
|
|
$(GO) mod tidy -diff
|
|
$(GO) vet ./...
|
|
$(PNPM) --dir $(WEB_DIR) run lint
|
|
$(PNPM) --dir $(WEB_DIR) run format
|
|
$(PNPM) --dir $(WEB_DIR) run build
|
|
$(GO) build -o $(APP) .
|
|
$(GO) test -count=1 . ./internal/...
|
|
git --no-pager diff --check
|
|
|
|
.PHONY: help
|
|
help: ## Display available targets
|
|
@awk 'BEGIN {FS = ":.*?## "; printf "Usage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z0-9_-]+:.*?## / { printf " \033[36m%-12s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
|