-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 835 Bytes
/
Makefile
File metadata and controls
35 lines (26 loc) · 835 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
BINARY_NAME := grant
VERSION ?= dev
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS := -s -w \
-X github.com/aaearon/grant-cli/cmd.version=$(VERSION) \
-X github.com/aaearon/grant-cli/cmd.commit=$(COMMIT) \
-X github.com/aaearon/grant-cli/cmd.buildDate=$(DATE)
.PHONY: build test test-race test-integration test-all test-coverage lint clean
build:
go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY_NAME) .
test:
go test ./... -v
test-race:
go test -race ./... -v
test-integration:
go test ./cmd -tags=integration -v
test-all: test-race test-integration
test-coverage:
go test -race -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
lint:
golangci-lint run ./...
clean:
rm -f $(BINARY_NAME) coverage.out
go clean