-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (48 loc) · 1.22 KB
/
Copy pathMakefile
File metadata and controls
59 lines (48 loc) · 1.22 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
50
51
52
53
54
55
56
57
58
59
.PHONY: build test lint proto swagger run clean help
# Build the application
build:
go build -o build/app main.go
# Run tests
test:
go test ./... -v
# Run tests with coverage
test-coverage:
go test ./... -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
# Run linter
lint:
golangci-lint run --timeout=5m
# Generate protobuf files
proto:
buf generate proto/
# Generate swagger documentation
swagger:
swag init
# Run the application
run:
go run main.go serve
# Run database migrations
migrate:
go run main.go migrate
# Seed the database
seed:
go run main.go seed
# Clean build artifacts
clean:
rm -rf build/
rm -rf api/
rm -rf docs/
rm -f coverage.out coverage.html
# Show help
help:
@echo "Available targets:"
@echo " build - Build the application"
@echo " test - Run tests"
@echo " test-coverage - Run tests with coverage report"
@echo " lint - Run linter"
@echo " proto - Generate protobuf files"
@echo " swagger - Generate swagger documentation"
@echo " run - Run the application"
@echo " migrate - Run database migrations"
@echo " seed - Seed the database"
@echo " clean - Clean build artifacts"