forked from socialpoint-labs/bsk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (29 loc) · 835 Bytes
/
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
PACKAGES=$(shell go list ./...)
LINTER_VERSION=1.18.0
lint:
goimports -w .
go mod verify
golangci-lint run
.PHONY: lint
test:
GORACE="halt_on_error=1" go test -race ./...
.PHONY: test
ci-lint:
fgt goimports -l .
go mod verify
golangci-lint run
.PHONY: ci-lint
ci-test:
echo "mode: count" > coverage-all.out
$(foreach pkg,$(PACKAGES),\
GORACE="halt_on_error=1" go test -race -cover -coverprofile=coverage.out $(pkg) || exit 1;\
tail -n +2 coverage.out >> coverage-all.out;)
.PHONY: ci-test
ci-check: ci-lint ci-test
.PHONY: ci-check
install-tools:
go get -u github.com/GeertJohan/fgt
go get -u golang.org/x/tools/cmd/cover
go get -u golang.org/x/tools/cmd/goimports
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v$(LINTER_VERSION)
.PHONY: install-tools