generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGNUmakefile
48 lines (38 loc) · 1.34 KB
/
GNUmakefile
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
default: testacc
DEV_VERSION=999.999.999
# Build provider and place it plugins directory to be able to sideload the built provider.
.PHONY: install
install:
go build -o ~/.terraform.d/plugins/registry.terraform.io/k-yomo/algolia/${DEV_VERSION}/darwin_arm64/terraform-provider-algolia
.PHONY: generate
generate:
go generate ./...
# Run acceptance tests
.PHONY: testacc
testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -race -coverprofile=coverage.out -timeout 120m
# Run acceptance tests and show coverages
.PHONY: testacc-cover
testacc-cover: testacc
go tool cover -func=coverage.out
go tool cover -html=coverage.out
.PHONY: teardown
teardown:
go run ./scripts/teardown.go
.PHONY: lint
lint:
@golangci-lint run
.PHONY: fmt
fmt:
goimports -w .
terraform fmt --recursive
.PHONY: fmt-check
fmt-check: fmt
@if [ "`git status --porcelain `" ]; then \
echo "Uncommitted changes were detected in the autogenerated docs folder. Please run 'make fmt' to autogenerate the docs, and commit the changes" && echo `git status --porcelain docs/` && exit 1; \
fi
.PHONY: docs-check
docs-check: generate
@if [ "`git status --porcelain docs/`" ]; then \
echo "Uncommitted changes were detected in the autogenerated docs folder. Please run 'make generate' to autogenerate the docs, and commit the changes" && echo `git status --porcelain docs/` && exit 1; \
fi