-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (30 loc) · 783 Bytes
/
Makefile
File metadata and controls
41 lines (30 loc) · 783 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
VERSION ?= 0.0.0
LDFLAGS = -ldflags "-X main.version=$(VERSION)"
DIST_DIR = dist
BINARY = agentbox
BIN_PATH = $(DIST_DIR)/$(BINARY)
.PHONY: deps build snapshot install test race cover lint clean
deps:
@go mod tidy
@go mod vendor
build:
@go build $(LDFLAGS) -o $(BIN_PATH) ./cmd/agentbox
snapshot:
@goreleaser release --snapshot --skip=publish --clean
install: build
@mkdir -p ~/.local/bin
@rm -f ~/.local/bin/$(BINARY)
@cp $(BIN_PATH) ~/.local/bin/
test:
@go test -timeout 3m -v ./...
race:
@go test -race -timeout 3m ./...
cover:
go test -race -coverprofile=coverage.out -timeout 3m ./...
go tool cover -func=coverage.out
@echo "---"
@echo "HTML report: go tool cover -html=coverage.out"
lint:
@prek run --all-files
clean:
@rm -rf $(DIST_DIR) coverage.out