generated from openmcp-project/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (41 loc) · 807 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
44
45
46
47
48
49
50
GO := go
PKG := ./...
COVERAGE_FILE := coverage.out
COVERAGE_HTML := coverage.html
# Default goal
.PHONY: all
all: clean build test
# Build the project
.PHONY: build
build:
$(GO) build -v $(PKG)
# Run tests with coverage
.PHONY: test
test:
$(GO) test -v -coverprofile=$(COVERAGE_FILE) $(PKG)
$(GO) tool cover -html=$(COVERAGE_FILE) -o $(COVERAGE_HTML)
@echo "Coverage report generated at $(COVERAGE_HTML)"
# Clean up generated files
.PHONY: clean
clean:
$(GO) clean
rm -f $(COVERAGE_FILE) $(COVERAGE_HTML)
# Format the code
.PHONY: fmt
fmt:
$(GO) fmt $(PKG)
# Lint the code
.PHONY: lint
lint:
golangci-lint run
# Run all checks
.PHONY: check
check: fmt lint test
# Install dependencies
.PHONY: deps
deps:
$(GO) mod tidy
$(GO) mod vendor
.PHONY: start
start:
$(GO) run cmd/server/main.go