-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathMakefile
49 lines (41 loc) · 1.2 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
DOCKER := $(shell which docker)
## help: Show this help message
help: Makefile
@echo " Choose a command run in "$(PROJECTNAME)":"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
.PHONY: help
## clean: clean testcache
clean:
@echo "--> Clearing testcache"
@go clean --testcache
.PHONY: clean
## cover: generate to code coverage report.
cover:
@echo "--> Generating Code Coverage"
@go install github.com/ory/go-acc@latest
@go-acc -o coverage.txt `go list ./...`
.PHONY: cover
## lint: Run linters golangci-lint and markdownlint.
lint:
@echo "--> Running golangci-lint"
@golangci-lint run
@echo "--> Running markdownlint"
@markdownlint --config .markdownlint.yaml '**/*.md'
@echo "--> Running yamllint"
@yamllint --no-warnings . -c .yamllint.yml
.PHONY: lint
## test-unit: Running unit tests
test-unit:
@echo "--> Running unit tests"
@go test `go list ./...`
.PHONY: test-unit
## test-unit-race: Running unit tests with data race detector
test-unit-race:
@echo "--> Running unit tests with data race detector"
@go test -race -count=1 `go list ./...`
.PHONY: test-unit-race
### test-all: Run tests with and without data race
test-all:
@$(MAKE) test-unit
@$(MAKE) test-unit-race
.PHONY: test-all