-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (42 loc) · 1.09 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
ROOT_DIR = $(shell pwd)
NAMESPACE = "default"
DEPLOY_NAME = "hitokoto-reviewer"
DOCKER_NAME = "hitokoto-reviewer"
GOOS = $(shell go env GOOS)
GOARCH = $(shell go env GOARCH)
include ./hack/hack.mk
dev:
gf run main.go
get-gf:
@echo "Installing gf..."
wget -O gf "https://github.com/gogf/gf/releases/latest/download/gf_${GOOS}_${GOARCH}" && chmod +x gf && ./gf install -y && rm ./gf
init-env: dep
@echo "Initializing environment..."
@go mod tidy;
@npm install;
dep: # get dependencies
@echo "Installing Dependencies..."
go mod download
lint: ## Lint Golang files
@echo;
@echo "Linting go codes with golangci-lint...";
@golangci-lint run ./... --color always
vet:
@echo "Checking go codes with go vet..."
go vet ./...
test:
@echo "Testing..."
@go test -short ${PKG_LIST}
test-coverage:
@go test -short -coverprofile cover.out -covermode=atomic ${PKG_LIST}
@cat cover.out >> coverage.txt
clean:
@rm -f coverage.txt
@rm -f cover.out
release:
@echo "Releasing by GoReleaser..."
@goreleaser release --rm-dist
precommit: lint test
go fmt ./...
go mod tidy
git add .