diff --git a/.gitignore b/.gitignore index 40776a1..854741a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,9 @@ mockgen/mockgen # vendor directory used for IDEs /vendor + +# tools +/bin +# coverage files +/cover.out +/cover.html diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..94bcf85 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +BIN = bin + +export GO111MODULE=on +export GOBIN ?= $(shell pwd)/$(BIN) + +GO_FILES = $(shell find . \ + -path '*/.*' -prune -o \ + '(' -type f -a -name '*.go' ')' -print) + +EXTRACT_CHANGELOG = $(BIN)/extract-changelog + +.PHONY: all +all: build test + +.PHONY: build +build: + go build ./... + +.PHONY: test +test: + go test -v -race ./... + +.PHONY: cover +cover: + go test -race -coverprofile=cover.out -coverpkg=./... ./... + go tool cover -html=cover.out -o cover.html + +$(EXTRACT_CHANGELOG): tools/cmd/extract-changelog/main.go + cd tools && go install github.com/uber-go/mock/tools/cmd/extract-changelog