forked from bitleak/go-redis-pool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (25 loc) · 895 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
34
# Many Go tools take file globs or directories as arguments instead of packages.
PKG_FILES ?= *.go
all: build
.PHONY: all
build: lint
go build .
test: setup-redis
go test
@cd scripts/redis && docker-compose down && cd ../..
coverage: setup-redis
go test -v -covermode=count -coverprofile=coverage.out
$(HOME)/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $(COVERAGE_TOKEN)
@cd scripts/redis && docker-compose down && cd ../..
lint:
@rm -rf lint.log
@printf $(CCCOLOR)"Checking format...\n"$(ENDCOLOR)
@gofmt -d -s $(PKG_FILES) 2>&1 | tee lint.log
@printf $(CCCOLOR)"Checking vet...\n"$(ENDCOLOR)
@go vet $(PKG_FILES) 2>&1 | tee -a lint.log;
@[ ! -s lint.log ]
setup-redis: nop
cd scripts/redis && docker-compose up -d && sleep 5 && docker-compose ps && cd ../..
teardown-redis: nop
cd scripts/redis && docker-compose down && cd ../..
nop: