-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (35 loc) · 882 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
37
38
39
40
41
42
43
# Description: Makefile for the project
# Variables
.DEFAULT_GOAL := help
# Targets
.PHONY: all
all: ## Install dependencies
@echo "Installing dependencies..."
@go mod download
.PHONY: clean
clean: ## Clean the project
@echo "Cleaning..."
@rm -rf bin/
.PHONY: test
test: ## Run tests
@echo "Running tests..."
@go test -v ./...
.PHONY: build
build: ## Build the project
@echo "Building..."
@go build -o bin/ ./...
.PHONY: run
run: ## Run the project
@echo "Running..."
@go run main.go
.PHONY: coverage
coverage: test ## Run coverage
@echo "Running coverage..."
@go test -race -coverprofile=coverage.txt -covermode=atomic ./...
@go tool cover -html=coverage.txt
.PHONY: help
help: ## Show this help
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-10s %s\n", $$1, $$2}' $(MAKEFILE_LIST)