forked from brizzai/fleet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (31 loc) · 943 Bytes
/
Copy pathMakefile
File metadata and controls
43 lines (31 loc) · 943 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
BINARY := brizz-code
BUILD_DIR := build
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
.PHONY: build run clean test fmt install lint coverage deps vet
build:
go build -v -ldflags "-s -w -X main.version=$(VERSION)" -o $(BUILD_DIR)/$(BINARY) ./cmd/brizz-code
run:
go run ./cmd/brizz-code
clean:
rm -rf $(BUILD_DIR)
go clean
test:
go test -race -v ./...
fmt:
go fmt ./...
lint:
golangci-lint run ./...
COVERAGE_EXCLUDE := /(ui|cmd|chrome|debuglog|diagnostics|update)/
coverage:
go test -race -coverprofile=coverage.out -covermode=atomic ./...
@echo "\n--- All packages ---"
@go tool cover -func=coverage.out | tail -1
@grep -v -E '$(COVERAGE_EXCLUDE)' coverage.out > coverage-core.out
@echo "--- Core packages (excl. UI, CLI, infra) ---"
@go tool cover -func=coverage-core.out | tail -1
deps:
go mod download
vet:
go vet ./...
install: build
cp $(BUILD_DIR)/$(BINARY) ~/.local/bin/