telegraph/Makefile

27 lines
840 B
Makefile
Raw Normal View History

2018-07-27 11:51:14 +00:00
PROJECT_NAME := $(CI_PROJECT_NAME)
PROJECT_NAMESPACE := $(CI_PROJECT_NAMESPACE)
2019-07-24 08:03:56 +00:00
PROJECT_PATH := "$(PROJECT_NAMESPACE)/$(PROJECT_NAME)"
2018-07-27 11:51:14 +00:00
PACKAGE_NAME := "gitlab.com/$(PROJECT_PATH)"
PACKAGE_LIST := $(shell go list $(PACKAGE_NAME)/... | grep -v /vendor/)
.PHONY: all lint test race coverage tidy
2018-07-27 11:51:14 +00:00
all: tidy test race lint
2018-07-27 11:51:14 +00:00
lint: ## Lint the files
2019-07-24 08:03:56 +00:00
@golangci-lint run ./...
2018-07-27 11:51:14 +00:00
test: ## Run unittests
2019-07-24 08:03:56 +00:00
@go test -short $(PACKAGE_NAME)/...
2018-07-27 11:51:14 +00:00
race: tidy ## Run data race detector
2018-07-27 11:51:14 +00:00
@go test -race -short ${PACKAGE_LIST}
coverage: ## Generate global code coverage report
2019-07-24 08:03:56 +00:00
@go test -cover -v -coverpkg=$(PACKAGE_NAME)/... ${PACKAGE_LIST}
2018-07-27 11:51:14 +00:00
tidy: ## Get the dependencies
@go mod tidy
2018-07-27 11:51:14 +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}'