github.com/philippseith/signalr@v0.6.3/Makefile (about) 1 PROJECT_NAME := "signalr" 2 PKG := "github.com/philippseith/$(PROJECT_NAME)" 3 PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/) 4 GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go) 5 6 .PHONY: all dep lint vet test test-coverage build clean 7 8 all: build 9 10 dep: ## Get the dependencies 11 @go mod download 12 13 lint: ## Lint Golang files 14 @golangci-lint run 15 16 vet: ## Run go vet 17 @go vet ${PKG_LIST} 18 19 test: ## Run unittests 20 @go test -race -short -count=1 ${PKG_LIST} 21 22 test-coverage: ## Run tests with coverage 23 @go test -race -short -count=1 -coverpkg=. -coverprofile cover.out -covermode=atomic ${PKG_LIST} 24 @cat cover.out >> coverage.txt 25 26 build: dep ## Build the binary file 27 @go build -o build/main $(PKG) 28 29 clean: ## Remove previous build 30 @rm -f $(PROJECT_NAME)/build 31 32 run-chatsample: ## run the local ./chatsample server 33 @go run ./chatsample/*.go 34 35 help: ## Display this help screen 36 @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'