-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (34 loc) · 987 Bytes
/
Makefile
File metadata and controls
53 lines (34 loc) · 987 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
44
45
46
47
48
49
50
51
52
53
SHELL=/bin/bash
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOCOVER=$(GOCMD) tool cover
GOLINT=golint
GO111MODULE=on
.PHONY: setup
setup: ## Install all the build and lint dependencies
$(GOGET) -u golang.org/x/tools/cmd/cover
$(GOGET) -u golang.org/x/lint/golint
.PHONY: build
build: ## Build the library
$(GOBUILD) -v ./...
.PHONY: test
test: ## Run all the tests
echo 'mode: atomic' > coverage.txt && $(GOTEST) -v -race -covermode=atomic -coverprofile=coverage.txt -timeout=30s ./...
.PHONY: clean
clean: ## Clean
$(GOCLEAN)
.PHONY: cover
cover: test ## Run all the tests and opens the coverage report
$(GOCOVER) -html=coverage.txt
.PHONY: lint
lint: ## Run the linter
$(GOLINT) ./...
.PHONY: ci
ci: lint test ## Run all the tests and code checks
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}'
.DEFAULT_GOAL := build