File tree Expand file tree Collapse file tree 3 files changed +148
-128
lines changed
Expand file tree Collapse file tree 3 files changed +148
-128
lines changed Original file line number Diff line number Diff line change 1+ # Flags for production build
2+ BUILD_FLAGS := -ldflags="-s -w" -trimpath -buildvcs=false -tags=performance
3+
4+ # Flags for test build (debugging, race detection, and more)
5+ TEST_BUILD_FLAGS := -race -gcflags=all="-N -l" -trimpath -tags=debug
6+
7+ # Default target: build for production
8+ all : build
9+
10+ # Build production binary (optimized for runtime speed and size)
11+ build :
12+ go build $(BUILD_FLAGS ) -o bin/percona-mongolink .
13+
14+ # Build test binary with race detection and debugging enabled
15+ test-build :
16+ go build $(TEST_BUILD_FLAGS ) -o bin/percona-mongolink_test .
17+
18+ # Run tests with race detection
19+ test :
20+ go test -race ./...
21+
22+ pytest :
23+ poetry run pytest
24+
25+ lint :
26+ golangci-lint run
27+
28+ # Clean generated files
29+ clean :
30+ rm -rf bin/*
31+ go clean -cache -testcache
32+
33+ .PHONY : all build test-build test clean
You can’t perform that action at this time.
0 commit comments