-
Notifications
You must be signed in to change notification settings - Fork 1
/
GNUmakefile
42 lines (30 loc) · 934 Bytes
/
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
TEST?=$$(go list ./... | grep -v /sdk$$)
GOFMT_FILES?=$$(find . -name '*.go')
PGK_NAME=sendgrid
default: build
build: fmtcheck
go install
$(MAKE) --directory=scripts doc
test: fmtcheck
@go test $(TEST) $(TESTARGS) -timeout=30s -parallel=4
testacc: fmtcheck
TF_ACC=1 go test ./$(PKG_NAME) -v $(TESTARGS) -timeout 1m
fmt:
@echo "==> Fixing source code with gofmt..."
gofmt -s -w ./$(PKG_NAME)
$(MAKE) --directory=scripts $@
fmtcheck:
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
lint: golangci-lint
golangci-lint:
@echo "==> Checking source code against golangci-lint..."
@golangci-lint run ./$(PKG_NAME)/...
@$(MAKE) --directory=scripts $@
sweep:
@rm -rf "$(CURDIR)/dist"
@$(MAKE) --directory=scripts $@
test-release:
goreleaser --snapshot --skip-publish --rm-dist
release:
goreleaser release --rm-dist
.PHONY: build test testacc fmt fmtcheck lint golangci-lint sweep test-release release