All checks were successful
CI / test (push) Successful in 35s
CI / build-and-package (amd64, darwin) (push) Successful in 1m7s
CI / build-and-package (amd64, linux) (push) Successful in 34s
CI / build-and-package (amd64, windows) (push) Successful in 1m9s
CI / build-and-package (arm64, darwin) (push) Successful in 1m11s
CI / build-and-package (arm64, linux) (push) Successful in 1m17s
40 lines
945 B
Makefile
40 lines
945 B
Makefile
.PHONY: all build test vet clean run fmt
|
|
|
|
APP := ratatoskr
|
|
CMD_DIR := ./cmd/ratatoskr
|
|
GO ?= go
|
|
GOPATH := $(shell $(GO) env GOPATH)
|
|
GOFLAGS ?= -ldflags="-s -w"
|
|
|
|
all: test build
|
|
|
|
build:
|
|
$(GO) build $(GOFLAGS) -o $(APP) $(CMD_DIR)
|
|
|
|
test:
|
|
$(GO) test ./... -v -count=1 -timeout 120s
|
|
|
|
vet:
|
|
$(GO) vet ./...
|
|
|
|
fmt:
|
|
$(GO) fmt ./...
|
|
|
|
run: build
|
|
./$(APP) -config config.yaml
|
|
|
|
clean:
|
|
rm -f $(APP)
|
|
rm -rf /tmp/ratatoskr-*
|
|
|
|
.PHONY: bench
|
|
bench:
|
|
$(GO) test ./... -bench=. -benchmem -count=1 -timeout 120s
|
|
|
|
.PHONY: cross
|
|
cross:
|
|
GOOS=linux GOARCH=amd64 $(GO) build $(GOFLAGS) -o $(APP)-linux-amd64 $(CMD_DIR)
|
|
GOOS=linux GOARCH=arm64 $(GO) build $(GOFLAGS) -o $(APP)-linux-arm64 $(CMD_DIR)
|
|
GOOS=darwin GOARCH=amd64 $(GO) build $(GOFLAGS) -o $(APP)-darwin-amd64 $(CMD_DIR)
|
|
GOOS=darwin GOARCH=arm64 $(GO) build $(GOFLAGS) -o $(APP)-darwin-arm64 $(CMD_DIR)
|
|
GOOS=windows GOARCH=amd64 $(GO) build $(GOFLAGS) -o $(APP)-windows-amd64.exe $(CMD_DIR)
|