CI: Gitea Actions workflow (test+build+package), Makefile, config.yaml.example, .gitignore
This commit is contained in:
38
Makefile
Normal file
38
Makefile
Normal file
@@ -0,0 +1,38 @@
|
||||
.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)
|
||||
Reference in New Issue
Block a user