Makefile 811 Bytes
Newer Older
endk-mirror-svc's avatar
endk-mirror-svc committed
1 2 3 4 5
PROJECT_NAME := "go-eds"
PKG := "gitlab.com/MadsRC/$(PROJECT_NAME)"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)

endk-mirror-svc's avatar
endk-mirror-svc committed
6
.PHONY: all build clean test coverage lint
endk-mirror-svc's avatar
endk-mirror-svc committed
7 8 9 10 11 12 13 14 15

all: build

lint: ## Lint the files
	@golint -set_exit_status ${PKG_LIST}

test: ## Run unittests
	@go test -short ${PKG_LIST}

endk-mirror-svc's avatar
endk-mirror-svc committed
16
race: ## Run data race detector
endk-mirror-svc's avatar
endk-mirror-svc committed
17 18 19 20 21 22 23 24 25 26 27
	@go test -race -short ${PKG_LIST}

coverage: ## Generate global code coverage report
	go test -covermode=count -coverprofile=coverage.out
	go tool cover -func=coverage.out

build: ## Build the binary file
	@go build -i -v $(PKG)

help: ## Display this help screen
	@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'