-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
66 lines (53 loc) · 1.65 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
GO_MK_REF := v2.0.3
# make go.mk a dependency for all targets
.EXTRA_PREREQS = go.mk
ifndef MAKE_RESTARTS
# This section will be processed the first time that make reads this file.
# This causes make to re-read the Makefile and all included
# makefiles after go.mk has been cloned.
Makefile:
@touch Makefile
endif
.PHONY: go.mk
.ONESHELL:
go.mk:
@if [ ! -d "go.mk" ]; then
git clone https://github.com/exoscale/go.mk.git
fi
@cd go.mk
@if ! git show-ref --quiet --verify "refs/heads/${GO_MK_REF}"; then
git fetch
fi
@if ! git show-ref --quiet --verify "refs/tags/${GO_MK_REF}"; then
git fetch --tags
fi
git checkout --quiet ${GO_MK_REF}
PACKAGE := github.com/exoscale/vault-plugin-secrets-exoscale
PROJECT_URL := https://$(PACKAGE)
GO_MAIN_PKG_PATH := ./cmd/vault-plugin-secrets-exoscale
go.mk/init.mk:
include go.mk/init.mk
GO_LD_FLAGS := -ldflags "-s -w -X $(PACKAGE)/version.Version=${VERSION} -X $(PACKAGE)/version.Commit=${GIT_REVISION}"
go.mk/public.mk:
include go.mk/public.mk
ifeq ($(VERSION), dev)
VERSION = v0.0.0+dev
endif
EXTRA_ARGS := -parallel 3 -count=1 -failfast
.PHONY: test-acc test-verbose test
test: GO_TEST_EXTRA_ARGS=${EXTRA_ARGS}
test-verbose: GO_TEST_EXTRA_ARGS+=$(EXTRA_ARGS)
test-acc: GO_TEST_EXTRA_ARGS=-v $(EXTRA_ARGS)
test-acc: ## Run acceptance tests (requires valid Exoscale API credentials)
$(GO) test \
-race \
-timeout $(GO_TEST_TIMEOUT) \
--tags=testacc \
$(GO_TEST_EXTRA_ARGS) \
$(GO_TEST_PKGS)
generate-mocks:
go install github.com/vektra/mockery/[email protected]
go generate
cover:
go test -cover -coverprofile=cover.out ./...
go tool cover -html cover.out