-
Notifications
You must be signed in to change notification settings - Fork 1
/
GNUmakefile
40 lines (31 loc) · 1.13 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
TEST?=$$(go list ./... |grep -v 'vendor'|grep -v 'examples')
GOFMT_FILES?=$$(find . -name '*.go')
WEBSITE_REPO=github.com/hashicorp/terraform-website
PKG_NAME=cloud66
VERSION=$(shell git describe --tags --always)
default: build
tools:
@echo "==> Installing development tooling..."
go generate -tags tools tools/tools.go
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH || $$GOPATH)/bin v1.51.1
build: vet fmt
go install
test: fmt
go test -covermode atomic -coverprofile=covprofile -v $(TEST) || exit 1
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 -race
testacc: fmt
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m -covermode atomic -coverprofile=covprofile
lint:
golangci-lint run ./...
vet:
@echo "==> Running go vet ."
@go vet ./... ; if [ $$? -ne 0 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi
fmt:
gofmt -w $(GOFMT_FILES)
docs: tools
@sh -c "'$(CURDIR)/scripts/generate-docs.sh'"