-
Notifications
You must be signed in to change notification settings - Fork 140
/
Copy pathMakefile
36 lines (30 loc) · 925 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
36
drepo ?= natsio
prometheus-nats-exporter.docker:
CGO_ENABLED=0 GOOS=linux go build -o $@ -v -a \
-tags netgo -tags timetzdata \
-installsuffix netgo -ldflags "-s -w"
.PHONY: dockerx
dockerx:
docker buildx bake --load
.PHONY: build
build:
go build
.PHONY: test
test:
go test -v -race -count=1 -parallel=1 ./test/...
go test -v -race -count=1 -parallel=1 ./collector/...
go test -v -race -count=1 -parallel=1 ./exporter/...
.PHONY: test-cov
test-cov:
go test -v -race -count=1 -parallel=1 ./test/...
go test -v -race -count=1 -parallel=1 -coverprofile=collector.out ./collector/...
go test -v -race -count=1 -parallel=1 -coverprofile=exporter.out ./exporter/...
.PHONY: lint
lint:
@PATH=$(shell go env GOPATH)/bin:$(PATH)
@if ! which golangci-lint >/dev/null; then \
echo "golangci-lint is required and was not found"; \
exit 1; \
fi
go vet ./...
$(shell go env GOPATH)/bin/golangci-lint run ./...