-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (23 loc) · 953 Bytes
/
Makefile
File metadata and controls
32 lines (23 loc) · 953 Bytes
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
.PHONY: all build run clean update list test mocks
all: # Runs build and run
go run main.go
go build main.go
run: # Runs the application locally
go run main.go
build: # Build the go application
go build main.go
clean: # Add missing and remove unused go modules
go mod tidy
update: # Install and update go modules
go get -u ./...
list: # List modules that are being used
go install github.com/icholy/gomajor@latest | gomajor list\
test: # Runs all the tests in the application and returns if they passed or failed, along with a coverage percentage
go install github.com/mfridman/tparse@latest | go mod tidy
go test -json -cover ./... | tparse -all -pass
mocks: # Install mock module and updates all mocks files
go install github.com/vektra/mockery/v2@latest
mockery --with-expecter --disable-version-string --all --output mocks
coverage:
go test -coverprofile=coverage.out -covermode=count ./...
go tool cover -func coverage.out