forked from grafana/xk6-client-tracing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (28 loc) · 716 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (28 loc) · 716 Bytes
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
BINARY ?= k6-tracing
IMAGE ?= ghcr.io/grafana/xk6-client-tracing
IMAGE_TAG ?= latest
GO_MODULE := $(shell head -n1 go.mod | cut -d' ' -f2)
GO_TEST_OPTS := -race -count=1 -cover -v
GO_LINT_OPTS := --config ./golangci.yml
XK6_BUILD_OPTS := --output ./$(BINARY)
.PHONY: build
build:
xk6 build $(XK6_BUILD_OPTS) --with $(GO_MODULE)=.
.PHONY: test
test:
go tool gotestsum --format=testname -- $(GO_TEST_OPTS) ./...
.PHONY: lint
lint:
golangci-lint run $(GO_LINT_OPTS) ./...
.PHONY: fmt
fmt:
go tool goimports -w ./
check-fmt: fmt
@git diff --exit-code
.PHONY: docker
docker:
docker build . -t $(IMAGE):$(IMAGE_TAG)
.PHONY: clean
clean:
go clean -cache -testcache
docker rmi -f $(IMAGE)