-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (21 loc) · 928 Bytes
/
Copy pathMakefile
File metadata and controls
29 lines (21 loc) · 928 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
IMAGE ?= distcache-tools:latest
GO_TEST_FLAGS ?= -race -coverprofile=coverage.out -covermode=atomic -coverpkg=./...
DOCKER_RUN := docker run --rm \
-v $(CURDIR):/app \
-w /app \
$(IMAGE)
.PHONY: image vendor mock lint test clean
image:
docker build -t $(IMAGE) -f Dockerfile .
vendor: image
$(DOCKER_RUN) sh -c 'go mod tidy && go mod vendor'
mock: image
$(DOCKER_RUN) sh -c '\
mockery --dir hash --name Hasher --keeptree --exported=true --with-expecter=true --inpackage=true --disable-version-string=true --output ./mocks/hash --case snake && \
mockery --dir discovery --name Provider --keeptree --exported=true --with-expecter=true --inpackage=true --disable-version-string=true --output ./mocks/discovery --case snake'
lint: image
$(DOCKER_RUN) golangci-lint run --timeout 10m --config .golangci.yml
test: image
$(DOCKER_RUN) go test -mod=vendor ./... $(GO_TEST_FLAGS)
clean:
-docker rmi $(IMAGE)