Files
gocryptotrader/Makefile
2019-08-23 21:59:01 +10:00

51 lines
1.2 KiB
Makefile

LDFLAGS = -ldflags "-w -s"
GCTPKG = github.com/thrasher-corp/gocryptotrader
LINTPKG = github.com/golangci/golangci-lint/cmd/golangci-lint@v1.16.0
LINTBIN = $(GOPATH)/bin/golangci-lint
GCTLISTENPORT=9050
GCTPROFILERLISTENPORT=8085
CRON = $(TRAVIS_EVENT_TYPE)
get:
GO111MODULE=on go get $(GCTPKG)
linter:
GO111MODULE=on go get $(GCTPKG)
GO111MODULE=on go get $(LINTPKG)
test -z "$$($(LINTBIN) run --verbose | tee /dev/stderr)"
check: linter test
test:
ifeq ($(CRON), cron)
go test -race -tags=mock_test_off -coverprofile=coverage.txt -covermode=atomic ./...
else
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
endif
build:
GO111MODULE=on go build $(LDFLAGS)
install:
GO111MODULE=on go install $(LDFLAGS)
fmt:
gofmt -l -w -s $(shell find . -type f -name '*.go')
update_deps:
GO111MODULE=on go mod verify
GO111MODULE=on go mod tidy
rm -rf vendor
GO111MODULE=on go mod vendor
.PHONY: profile_heap
profile_heap:
go tool pprof -http "localhost:$(GCTPROFILERLISTENPORT)" 'http://localhost:$(GCTLISTENPORT)/debug/pprof/heap'
.PHONY: profile_cpu
profile_cpu:
go tool pprof -http "localhost:$(GCTPROFILERLISTENPORT)" 'http://localhost:$(GCTLISTENPORT)/debug/pprof/profile'
db_migrate:
go run ./cmd/dbmigrate