-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 874 Bytes
/
Makefile
File metadata and controls
34 lines (25 loc) · 874 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
VERSION ?= dev
COMMIT := $(shell git rev-parse --short HEAD)
DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -X github.com/sethdeckard/loadout/cmd/loadout/cmd.version=$(VERSION) \
-X github.com/sethdeckard/loadout/cmd/loadout/cmd.commit=$(COMMIT) \
-X github.com/sethdeckard/loadout/cmd/loadout/cmd.date=$(DATE)
.PHONY: build test test-race cover cover-html lint vet clean
build:
go build -ldflags "$(LDFLAGS)" -o loadout ./cmd/loadout
test:
go test ./...
test-race:
go test -race ./...
cover:
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
cover-html:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
vet:
go vet ./...
lint:
GOCACHE=$(CURDIR)/.cache/go-build GOLANGCI_LINT_CACHE=$(CURDIR)/.cache/golangci-lint golangci-lint run ./...
clean:
rm -f loadout coverage.out