forked from redpanda-data/terraform-provider-redpanda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (51 loc) · 1.58 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
67
.PHONY: all doc int unit test lint linter tfplugindocs_install generate_docs integration_tests unit_tests install_gofumpt install_lint
GOBIN := $(PWD)/tools
TFPLUGINDOCSCMD := $(GOBIN)/tfplugindocs
GOCMD=go
BUFCMD=buf
GOFUMPTCMD=gofumpt
GOLANGCILINTCMD=golangci-lint
all: doc lint test
doc: tfplugindocs_install generate_docs
int: integration_tests
unit: unit_tests
test: unit_tests integration_tests
lint: install_gofumpt install_lint linter
ready: doc lint tidy
tidy:
@echo "running go mod tidy..."
@$(GOCMD) mod tidy
tfplugindocs_install:
@echo "installing tfplugindocs..."
@GOBIN=$(GOBIN) $(GOCMD) install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest
generate_docs: tfplugindocs_install
@echo "generating provider_documentation..."
@$(TFPLUGINDOCSCMD)
integration_tests:
@echo "running integration tests..."
@DEBUG=true \
REDPANDA_CLIENT_ID=$${REDPANDA_CLIENT_ID} \
REDPANDA_CLIENT_SECRET=$${REDPANDA_CLIENT_SECRET} \
RUN_CLUSTER_TESTS=true \
TF_ACC=true \
VERSION=ign \
$(GOCMD) test -v -parallel=5 -timeout=0 ./redpanda/tests
unit_tests:
@echo "running unit tests..."
@DEBUG=true \
REDPANDA_CLIENT_ID="dummy_id" \
REDPANDA_CLIENT_SECRET="dummy_secret" \
TF_ACC=false \
RUN_CLUSTER_TESTS=false \
$(GOCMD) test -short ./...
install_gofumpt:
@echo "installing gofumpt..."
@$(GOCMD) install mvdan.cc/[email protected]
install_lint:
@echo "installing linter..."
@$(GOCMD) install github.com/golangci/golangci-lint/cmd/[email protected]
linter:
@echo "running gofumpt..."
@$(GOFUMPTCMD) -w -d .
@echo "running linter..."
@$(GOLANGCILINTCMD) run