Files
gocqlx/Makefile

44 lines
803 B
Makefile
Raw Normal View History

2018-08-07 15:30:04 +02:00
all: check test
2017-07-21 15:13:09 +02:00
2018-07-28 06:41:33 +02:00
ifndef GOBIN
export GOBIN := $(GOPATH)/bin
endif
2018-08-07 15:30:04 +02:00
define dl
@curl -sSq -L $(2) -o $(GOBIN)/$(1) && chmod u+x $(GOBIN)/$(1)
endef
define dl_tgz
@curl -sSq -L $(2) | tar zxf - --strip 1 -C $(GOBIN) --wildcards '*/$(1)'
endef
2018-07-28 06:41:33 +02:00
.PHONY: fmt
2018-08-07 15:30:04 +02:00
fmt:
2018-07-28 06:41:33 +02:00
@go fmt ./...
2017-07-21 15:13:09 +02:00
.PHONY: check
2018-08-07 15:30:04 +02:00
check:
@$(GOBIN)/golangci-lint run ./...
2018-05-22 14:47:43 +02:00
2018-05-25 11:02:52 +02:00
GOTEST := go test -cover -race -tags all
2017-07-21 15:13:09 +02:00
.PHONY: test
test:
2018-05-25 11:02:52 +02:00
@$(GOTEST) .
@$(GOTEST) ./migrate
@$(GOTEST) ./qb
@$(GOTEST) ./table
2018-05-22 16:40:31 +02:00
.PHONY: bench
bench:
@go test -tags all -run=XXX -bench=. -benchmem ./...
2017-07-21 15:13:09 +02:00
.PHONY: get-deps
get-deps:
go get -t ./...
2018-05-22 14:47:43 +02:00
.PHONY: get-tools
get-tools:
@echo "==> Installing tools at $(GOBIN)..."
@$(call dl_tgz,golangci-lint,https://github.com/golangci/golangci-lint/releases/download/v1.10.2/golangci-lint-1.10.2-linux-amd64.tar.gz)