-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (24 loc) · 1010 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
SHELL = bash
APP := $(shell basename $(PWD) | tr '[:upper:]' '[:lower:]')
GIT_COMMIT_HASH ?= $(shell git rev-parse HEAD)
GIT_SHORT_COMMIT_HASH := $(shell git rev-parse --short HEAD)
.PHONY: all
all: test
.PHONY: clean
clean: ## Cleans out all generated items
-@rm -rf coverage
-@rm -f coverage.txt
.PHONY: coverage
coverage: ## Generates the code coverage from all the tests
docker run -v $$PWD:/go$${PWD/$$GOPATH} --workdir /go$${PWD/$$GOPATH} gomicro/gocover
.PHONY: help
help: ## Show This Help
@for line in $$(cat Makefile | grep "##" | grep -v "grep" | sed "s/:.*##/:/g" | sed "s/\ /!/g"); do verb=$$(echo $$line | cut -d ":" -f 1); desc=$$(echo $$line | cut -d ":" -f 2 | sed "s/!/\ /g"); printf "%-30s--%s\n" "$$verb" "$$desc"; done
.PHONY: linters
linters: ## Run all the linters
docker run -v $$PWD:/go$${PWD/$$GOPATH} --workdir /go$${PWD/$$GOPATH} gomicro/golinters
.PHONY: test
test: unit_test ## Run all available tests
.PHONY: unit_test
unit_test: ## Run unit tests
go test ./...