dharma/Makefile
Felipe M. 44680b35cc
All checks were successful
CI / format (push) Successful in 21s
CI / goreleaser-lint (push) Successful in 13s
CI / lint (push) Successful in 1m58s
CI / test (push) Successful in 1m23s
CI / build (push) Successful in 2m16s
ci: migrate from Woodpecker CI to Forgejo Actions (#1)
Replace Woodpecker CI pipeline with Forgejo Actions workflows using
ci-base container image. Simplify Makefile to match current project
conventions and add ldflags to goreleaser for smaller binaries.

Reviewed-on: #1
Co-authored-by: Felipe M. <me@fmartingr.com>
Co-committed-by: Felipe M. <me@fmartingr.com>
2026-04-08 10:25:56 +02:00

52 lines
1 KiB
Makefile

PROJECT_NAME := dharma
CGO_ENABLED := 0
DIST_PATH := ./dist
TEST_OPTIONS := -v -failfast -race -cover
GOLANGCI_LINT_VERSION := v1.64.5
.DEFAULT_GOAL := help
## help: Display this help message
.PHONY: help
help:
@echo "Available targets:"
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## / /' | sort
## build: Build project using goreleaser (snapshot)
.PHONY: build
build:
goreleaser build --snapshot --clean
## run: Run the project directly
.PHONY: run
run:
go run ./cmd/$(PROJECT_NAME)
## format: Format code and tidy modules
.PHONY: format
format:
go fmt ./...
go mod tidy
## ci-lint: Run golangci-lint (installs if missing)
.PHONY: ci-lint
ci-lint:
@which golangci-lint > /dev/null 2>&1 || go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
golangci-lint run ./...
## lint: Run linters
.PHONY: lint
lint: ci-lint
## test: Run tests with coverage
.PHONY: test
test:
CGO_ENABLED=1 go test $(TEST_OPTIONS) -timeout 1m ./...
## clean: Remove build artifacts
.PHONY: clean
clean:
rm -rf $(DIST_PATH)
go clean -cache