-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (29 loc) · 848 Bytes
/
Copy pathMakefile
File metadata and controls
41 lines (29 loc) · 848 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
.PHONY: build test test-integration vet fmt clean tidy lint vulncheck
BIN := bin/pinax
PKG := ./...
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo none)
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -s -w \
-X pinax/internal/buildinfo.Version=$(VERSION) \
-X pinax/internal/buildinfo.Commit=$(COMMIT) \
-X pinax/internal/buildinfo.Date=$(DATE)
build:
@mkdir -p bin
go build -trimpath -ldflags="$(LDFLAGS)" -o $(BIN) ./cmd/pinax
test:
go test -race -timeout 120s $(PKG)
test-integration:
go test -tags integration -timeout 10m $(PKG)
vet:
go vet $(PKG)
lint:
golangci-lint run
vulncheck:
go run golang.org/x/vuln/cmd/govulncheck@latest $(PKG)
fmt:
gofmt -s -w .
tidy:
go mod tidy
clean:
rm -rf bin coverage.out