.PHONY: test fmt lint build clean all # Build variables VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev") COMMIT := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown") # Linker flags LDFLAGS := -X 'git.eeqj.de/sneak/vaultik/internal/globals.Version=$(VERSION)' \ -X 'git.eeqj.de/sneak/vaultik/internal/globals.Commit=$(COMMIT)' # Default target all: test # Run tests test: lint go test -v ./... # Format code fmt: go fmt ./... # Run linter lint: golangci-lint run # Build binary build: go build -ldflags "$(LDFLAGS)" -o vaultik ./cmd/vaultik # Clean build artifacts clean: rm -f vaultik go clean # Install dependencies deps: go mod download go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest # Run tests with coverage test-coverage: go test -v -coverprofile=coverage.out ./... go tool cover -html=coverage.out -o coverage.html # Run integration tests test-integration: go test -v -tags=integration ./...