-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (31 loc) · 1.2 KB
/
Makefile
File metadata and controls
44 lines (31 loc) · 1.2 KB
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
.PHONY: all
.DEFAULT_GOAL := help
PROJECT_ROOT:=$(shell git rev-parse --show-toplevel)
COMMIT := $(shell git rev-parse --short HEAD)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
REPO := $(shell basename `git rev-parse --show-toplevel`)
DATE := $(shell date +%Y-%m-%d-%H-%M-%S)
APP_NAME := $(shell basename `git rev-parse --show-toplevel`)
MAKE_LIB:=$(PROJECT_ROOT)/scripts
-include $(MAKE_LIB)/lints.mk
-include $(MAKE_LIB)/tools.mk
COVER_OUTPUT_RAW := coverage.out
COVER_OUTPUT_HTML := coverage.html
test: lint scan ## Run unit tests
go test --short -cover -failfast ./...
test-watch: ## Run unit tests in watch mode
@gow test -coverprofile $(COVER_OUTPUT_RAW) --short -cover -failfast ./...
scan: ## run security scan
gosec ./...
govulncheck ./...
lint: ## run linter
go vet ./...
golangci-lint run ./...
docgen: test ## generate go doc and append to readme.
gomarkdoc -o README.md -e .
install: get-tools ## install tools + dependencies
# HELP
# This will output the help for each task
# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)