-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
36 lines (27 loc) · 922 Bytes
/
Makefile
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
.PHONY: all build_shell test lint bench clean
export GOEXPERIMENT=arenas
PROJECT_NAME := "goannoy"
BUILD_DIR := "bin"
CMD_SHELL := "./cmd/shell"
TEST_DIR := "./tests"
TEST_TIMEOUT := 720s
COVERAGE_FILE := "coverage.out"
all: build_shell test lint
build: build_shell
build_shell:
@echo "Building $(PROJECT_NAME) shell command..."
@go build -o $(BUILD_DIR)/$(PROJECT_NAME) $(CMD_SHELL)
test:
@echo "Running tests with timeout $(TEST_TIMEOUT) and generating coverage..."
@go test -timeout $(TEST_TIMEOUT) -coverprofile=$(COVERAGE_FILE) $(TEST_DIR)/... -v -coverpkg ./...
@go tool cover -func=$(COVERAGE_FILE)
lint:
@echo "Running lint checks..."
@golangci-lint run ./...
bench:
@echo "Running benchmarks..."
@go test -bench=. -run=none ./...
clean:
@echo "Cleaning build artifacts and coverage information..."
@rm -rf $(BUILD_DIR) $(COVERAGE_FILE)
@rm -rf tests/*.ann *.ann results.txt tests/results.txt