Files
Valentin Popov e074eeedf2
Deploy / Test, build and deploy (push) Failing after 2m15s
eleventh version
2026-06-08 15:33:56 +00:00

52 lines
1.2 KiB
Makefile

export GOCACHE := $(CURDIR)/.cache/go-build
export GOMODCACHE := $(CURDIR)/.cache/go-mod
export GOLANGCI_LINT_CACHE := $(CURDIR)/.cache/golangci-lint
export GOTELEMETRY := off
export TMPDIR := $(CURDIR)/.tmp
GO := go
.PHONY: cache fmt vet lint test race integration sandbox tidy run migrate build backtest
cache:
mkdir -p $(GOCACHE) $(GOMODCACHE) $(GOLANGCI_LINT_CACHE) $(TMPDIR) bin
fmt: cache
$(GO) fmt ./...
vet: cache
$(GO) vet ./...
lint: cache
golangci-lint run ./...
test: cache
$(GO) test ./...
race: cache
$(GO) test -race ./...
integration: cache
GOMODCACHE=$(CURDIR)/.cache/go-mod-integration-v42 GOCACHE=$(CURDIR)/.cache/go-build-integration-v42 $(GO) test -tags=integration ./...
sandbox: cache
$(GO) test -tags=sandbox ./...
tidy: cache
$(GO) mod tidy
run: cache
$(GO) run ./cmd/bot
migrate: cache
$(GO) run ./cmd/migrate -direction=up
build: cache
$(GO) build -trimpath -o bin/bot ./cmd/bot
$(GO) build -trimpath -o bin/migrate ./cmd/migrate
$(GO) build -trimpath -o bin/backtest ./cmd/backtest
$(GO) build -trimpath -o bin/mode-days ./cmd/mode-days
backtest: cache
$(GO) run ./cmd/backtest -candles "$${BT_CANDLES:?set BT_CANDLES}"