-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (36 loc) · 1.23 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
GOLANGCI_VERSION ?= v1.54.2
GOVULNCHECK_VERSION ?= v1.0.1
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
.PHONY: default
default: test
.PHONY: install-govulncheck
install-govulncheck:
@GOBIN=$(ROOT_DIR)/bin go install golang.org/x/vuln/cmd/govulncheck@$(GOVULNCHECK_VERSION)
.PHONY: install-golangci
install-golangci:
@test -f ./bin/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- $(GOLANGCI_VERSION)
.PHONY: go-lint
go-lint: install-govulncheck install-golangci
@./bin/govulncheck ./...
@./bin/golangci-lint run
.PHONY: lint
lint: go-lint
.PHONY: test-short
test-short:
go test -cover -coverprofile=.coverage.out -count=10 -short -race -timeout 10s ./...
.PHONY: test
test:
go test -cover -coverprofile=.coverage.out -count=2 -race -timeout 300s ./...
.PHONY: coverage-show
coverage-show:
go tool cover -func=.coverage.out
.PHONY: coverage-html
coverage-html:
go tool cover -html=.coverage.out
.PHONY: bench
bench:
go test -bench . -test.benchmem -test.count 2 -test.benchtime 2s
.PHONY: download-segments
download-segments:
rm -f segments.json 2>/dev/null
wget https://storage.googleapis.com/weaviate-tech-challenges/db-engineer/segments.json