-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
79 lines (66 loc) · 1.61 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Makefile for Teleport Discord Bot
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
GOMOD=$(GOCMD) mod
BINARY_NAME=teleport-discord-bot
MAIN_PATH=./cmd/teleport-discord-bot
# Environment
export GO111MODULE=on
# Default target
.PHONY: all
all: test build
# Build the application
.PHONY: build
build:
$(GOBUILD) -o $(BINARY_NAME) $(MAIN_PATH)
# Run tests
.PHONY: test
test:
$(GOTEST) -v ./...
# Run tests with coverage
.PHONY: test-coverage
test-coverage:
$(GOTEST) -coverprofile=coverage.out ./...
$(GOCMD) tool cover -html=coverage.out
# Clean up build artifacts
.PHONY: clean
clean:
rm -f $(BINARY_NAME)
rm -f coverage.out
# Lint the code
.PHONY: lint
lint:
golangci-lint run
# Install dependencies
.PHONY: deps
deps:
$(GOMOD) download
$(GOMOD) tidy
# Run the application locally
.PHONY: run
run:
go run $(MAIN_PATH)/main.go
# Development setup
.PHONY: setup
setup:
@echo "Installing development tools..."
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
.PHONY: digest
digest:
npx ai-digest --whitespace-removal
# Help target
.PHONY: help
help:
@echo "Available targets:"
@echo " all - Run tests and build the application"
@echo " build - Build the application"
@echo " test - Run tests"
@echo " test-coverage - Run tests with coverage report"
@echo " clean - Remove build artifacts"
@echo " lint - Run golangci-lint"
@echo " deps - Download and tidy dependencies"
@echo " run - Build and run the application"
@echo " setup - Install development tools"
@echo " help - Show this help message"