-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (42 loc) · 1.72 KB
/
Makefile
File metadata and controls
49 lines (42 loc) · 1.72 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
37
38
39
40
41
42
43
44
45
46
47
48
49
# Makefile para PSO HTTP Server (Go)
APP_NAME=pso-http-server
CMD_PATH=./cmd/server
BUILD_DIR=./bin
.PHONY: all build run test-all lint clean
all: build
# ------------------------------------------------------------
# Compilar el proyecto
# ------------------------------------------------------------
build:
@echo "Compilando $(APP_NAME)..."
@mkdir -p $(BUILD_DIR)
@go build -o $(BUILD_DIR)/$(APP_NAME) $(CMD_PATH)
@echo "Build completado: $(BUILD_DIR)/$(APP_NAME)"
# ------------------------------------------------------------
# Ejecutar el binario compilado
# ------------------------------------------------------------
run:
@echo "Ejecutando servidor..."
@$(BUILD_DIR)/$(APP_NAME)
# ------------------------------------------------------------
# Ejecutar TODOS los tests con cobertura
# ------------------------------------------------------------
test-all:
@echo "===================================================="
@echo "Running all tests with coverage"
@echo "===================================================="
go test ./tests -v -count=1 \
-coverpkg=github.com/EngSteven/pso-http-server/internal/algorithms \
-coverprofile=reports/coverage.out
# ------------------------------------------------------------
# Linter (opcional)
# ------------------------------------------------------------
lint:
@echo "Ejecutando linter..."
@golangci-lint run || echo "Linter detectó advertencias"
# ------------------------------------------------------------
# Limpiar binarios y reportes
# ------------------------------------------------------------
clean:
@echo " Limpiando archivos compilados y reportes..."
@rm -rf $(BUILD_DIR) reports test_report.txt coverage.out