1
0
Fork 0
telegram/Makefile

30 lines
988 B
Makefile
Raw Normal View History

2018-07-29 15:41:59 +00:00
PROJECT_NAMESPACE := $(CI_PROJECT_NAMESPACE)
PROJECT_NAME := $(CI_PROJECT_NAME)
2019-07-26 10:17:35 +00:00
PROJECT_PATH := "$(PROJECT_NAMESPACE)/$(PROJECT_NAME)"
2018-07-29 15:41:59 +00:00
PACKAGE_NAME := "gitlab.com/$(PROJECT_PATH)"
2019-07-26 10:17:35 +00:00
PACKAGE_PATH := "$(GOPATH)/src/$(PACKAGE_NAME)"
2018-07-29 15:41:59 +00:00
PACKAGE_LIST := $(shell go list $(PACKAGE_NAME)/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
2019-07-26 10:17:35 +00:00
.PHONY: all lint test rase coverage dep
2018-07-29 15:41:59 +00:00
2019-07-26 10:17:35 +00:00
all: dep test race lint
2018-07-29 15:41:59 +00:00
lint: ## Lint the files
2019-07-26 10:17:35 +00:00
@golangci-lint run ./...
2018-07-29 15:41:59 +00:00
test: ## Run unittests
2019-07-26 10:17:35 +00:00
@go test -short $(PACKAGE_NAME)/...
2018-07-29 15:41:59 +00:00
race: dep ## Run data race detector
@go test -race -short ${PACKAGE_LIST}
coverage: ## Generate global code coverage report
2019-07-26 10:17:35 +00:00
@go test -cover -v -coverpkg=$(PACKAGE_NAME)/... ${PACKAGE_LIST}
2018-07-29 15:41:59 +00:00
dep: ## Get the dependencies
2019-07-26 10:17:35 +00:00
@go get -v -d -t $(PACKAGE_NAME)/...
2018-07-29 15:41:59 +00:00
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}'