generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
55 lines (42 loc) · 1.07 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
air:
@echo "Running the Go project using Air..."
air
run:
@echo "Running the Go project..."
go run .
ngrok:
@echo "Running the Go project using Ngrok..."
ngrok http 8999
tidy:
@echo "Running the Go project tidy..."
@go mod tidy
download:
@echo "Running the Go project tidy..."
@go mod download
fmt:
@echo "Running the Go project fmt..."
@go fmt ./...
test:
@echo "Running the Go project tests..."
@go list ./... | grep -v "/config$$" | grep -v "/routes$$" | xargs go test -v -coverprofile=coverage.out
coverage:
@echo "Running the Go project tests with coverage..."
@go tool cover -func=coverage.out
@go tool cover -html=coverage.out -o coverage.html
clean:
@echo "Cleaning the Go project..."
@rm -rf coverage
@rm -rf coverage.out
@rm -rf coverage.html
register:
@echo "Registering commands..."
@go run commands/main/register.go
@echo "Registration complete."
test-cover:
ifeq ($(FORCE),1)
@echo "Force flag detected. Cleaning before tests..."
@$(MAKE) clean
endif
@$(MAKE) test
@$(MAKE) coverage
@echo "Tests completed and coverage report generated."