-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (34 loc) · 725 Bytes
/
Makefile
File metadata and controls
44 lines (34 loc) · 725 Bytes
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
.PHONY: build run test lint clean
APP_NAME := harnessclaw-engine
BUILD_DIR := ./dist
CMD := ./cmd/server
# Build the binary
build:
@echo "Building $(APP_NAME)..."
go build -o $(BUILD_DIR)/$(APP_NAME) $(CMD)
# Run the server
run:
go run $(CMD) -config ./configs/config_self.yaml
# Run tests
test:
go test ./... -v -race -count=1
# Run tests with coverage
test-cover:
go test ./... -v -race -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
# Lint
lint:
golangci-lint run ./...
# Format
fmt:
gofmt -s -w .
goimports -w .
# Tidy modules
tidy:
go mod tidy
# Clean build artifacts
clean:
rm -rf $(BUILD_DIR) coverage.out coverage.html
# Vulnerability check
vuln:
govulncheck ./...