-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (47 loc) · 1.14 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
.DEFAULT_GOAL := build
.PHONY: api
api:
go run ./cmd/api/main.go
.PHONY: gen
gen:
@echo "start generating code"
go generate ./...
@echo "start generating code"
.PHONY: lint
lint:
@echo "start linting"
golangci-lint run
@echo "finished linting"
.PHONY: test
test: build
@echo "start running test"
GOARCH=amd64 go test -cover ./...
@echo "finished running test"
.PHONY: test-cov
test-cov:
@echo "start running test coverage 😱😱😱"
GOARCH=amd64 go test ./... -coverprofile=coverage.out.tmp
cat coverage.out.tmp | grep -v "mock" > coverage.out
go tool cover -html=coverage.out -o coverage.html
open coverage.html
@echo "done test! good job bro! 🎉🎉🎉"
.PHONY: build
build: gen lint
@echo "start building application 😱😱😱"
go build -o bin/api/main ./cmd/api/main.go
@echo "finished building application"
.PHONY: wire
wire:
@echo "start wiring"
wire ./...
@echo "finished generating wire"
.PHONY: swagger
swag:
@echo "start swagging"
swag init --parseDependency -g cmd/api/main.go
@echo "finished swagging"
.PHONY: swag-fmt
swag-fmt:
@echo "start formating swagger docs"
swag fmt
@echo "finished formating swagger docs"