Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Flags for production build
BUILD_FLAGS := -ldflags="-s -w" -trimpath -buildvcs=false -tags=performance

# Flags for test build (debugging, race detection, and more)
TEST_BUILD_FLAGS := -race -gcflags=all="-N -l" -trimpath -tags=debug

# Default target: build for production
all: build

# Build production binary (optimized for runtime speed and size)
build:
go build $(BUILD_FLAGS) -o bin/percona-mongolink .

# Build test binary with race detection and debugging enabled
test-build:
go build $(TEST_BUILD_FLAGS) -o bin/percona-mongolink_test .

# Run tests with race detection
test:
go test -race ./...

pytest:
poetry run pytest

lint:
golangci-lint run

# Clean generated files
clean:
rm -rf bin/*
go clean -cache -testcache

.PHONY: all build test-build test clean
Loading
Loading