-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (29 loc) · 797 Bytes
/
Makefile
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
SHELL=/bin/bash
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOLINT=golangci-lint
GO111MODULE=on
.PHONY: download
download: ## Download module dependencies
go mod download
.PHONY: build
build: ## Build the library
$(GOBUILD) -v ./...
.PHONY: lint
lint: ## Run the linter
$(GOLINT) run ./...
.PHONY: test
test: ## Run all the tests
echo 'mode: atomic' > coverage.txt && $(GOTEST) -v -race -covermode=atomic -coverprofile=coverage.txt -timeout=30s ./...
.PHONY: ci
ci: lint test ## Run all the tests and code checks
.PHONY: clean
clean: ## Clean
$(GOCLEAN) -testcache
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}'
.DEFAULT_GOAL := build