forked from EasyPost/easypost-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (40 loc) · 1.26 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
PROJECT_NAME := easypost-go
PROJECT_PATH := $$(go env GOPATH)/bin/$(PROJECT_NAME)
DIST_PATH := dist
## help - Display help about make targets for this Makefile
help:
@cat Makefile | grep '^## ' --color=never | cut -c4- | sed -e "`printf 's/ - /\t- /;'`" | column -s "`printf '\t'`" -t
## build - Build the project
build:
go build -o ../$(DIST_PATH)/$(PROJECT_NAME)
## clean - Clean the project
clean:
rm -rf $(DIST_PATH)
rm $(PROJECT_PATH)
## coverage - Get test coverage and open it in a browser
coverage:
go clean -testcache && go test ./tests -coverprofile=covprofile -coverpkg=./... && go tool cover -html=covprofile
## install - Install and vendor dependencies
install:
brew install golangci-lint || exit 0
git submodule init
git submodule update
go mod vendor
go build -o $(PROJECT_PATH)
## lint - Lint the project
lint:
golangci-lint run
## release - Cuts a release for the project on GitHub (requires GitHub CLI)
# tag = The associated tag title of the release
release:
gh release create ${tag}
## gosec - Run gosec to scan for security issues
scan:
gosec ./...
## test - Test the project
test:
go clean -testcache && go test ./tests
## tidy - Tidies up the vendor directory
tidy:
go mod tidy
.PHONY: help build clean coverage install lint scan test tidy