-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 1.02 KB
/
Makefile
File metadata and controls
36 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
BINARY_NAME=lstk
ifeq ($(OS),Windows_NT)
BINARY_NAME=lstk.exe
endif
BUILD_DIR=bin
export CGO_ENABLED=0
.PHONY: build clean test test-integration lint mock-generate otel
$(BUILD_DIR)/$(BINARY_NAME):
go build -o $(BUILD_DIR)/$(BINARY_NAME) .
build: clean $(BUILD_DIR)/$(BINARY_NAME)
clean:
rm -rf $(BUILD_DIR)
test:
@JUNIT=""; [ -n "$$CREATE_JUNIT_REPORT" ] && JUNIT="--junitfile test-results.xml"; \
go run gotest.tools/gotestsum@latest --format testname $$JUNIT -- ./cmd/... ./internal/...
test-integration: $(BUILD_DIR)/$(BINARY_NAME)
@RUN="$(RUN)" ./scripts/test-integration.sh
otel:
docker compose -f docker-compose.tracing.yaml up -d
mock-generate:
go generate ./...
lint:
@EXPECTED=$$(awk '/^golangci-lint/ {print $$2}' .tool-versions); \
INSTALLED=$$(golangci-lint version --short 2>/dev/null | sed 's/^v//'); \
[ "$$INSTALLED" = "$$EXPECTED" ] || { echo "golangci-lint $$EXPECTED required (found: $$INSTALLED)"; exit 1; }
golangci-lint run --tests ./...
(cd test/integration && golangci-lint run --tests ./...)