-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathMakefile.devel
51 lines (42 loc) · 1.36 KB
/
Makefile.devel
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
##@ Development
.PHONY: release
release: fmt tidy ## Release a new version
ifneq ($(strip $(GIT_DIRTY)),)
$(Q) echo "Git is currently in a dirty state. Please commit your changes or stash them before you release."; exit 1;
else
$(Q) read -p "Release version: $(VERSION) → " version; sed -i "s/$(VERSION)/$$version/g" spotinst/version.go
$(Q) git commit -a -m "chore(release): $(RELEASE)"
$(Q) git tag -f -m "chore(release): $(RELEASE)" $(RELEASE)
$(Q) git push --follow-tags
endif
.PHONY: test
test: fmt ## Run all tests
$(Q) mkdir -p $(TEST_DIR)
$(Q) $(GO) test \
-v $$($(GO) list ./... | grep -v vendor) $(TESTARGS) \
-covermode=atomic \
-coverprofile=$(GO_COVERAGE) \
-race \
-timeout=30s \
-parallel=4
.PHONY: cover
cover: test ## Run all tests and open the coverage report
$(Q) $(GO) tool cover -html=$(GO_COVERAGE)
.PHONY: tidy
tidy: ## Add missing and remove unused modules
$(Q) $(GO) mod tidy
.PHONY: vendor
vendor: ## Make vendored copy of all dependencies
$(Q) $(GO) mod vendor
.PHONY: fmt
fmt: ## Format the code
$(Q) go fmt $$($(GO) list -f {{.Dir}} ./... | grep -v /vendor/)
.PHONY: imports
imports: ## Optimize imports
$(Q) goimports -w $$($(GO) list -f {{.Dir}} ./... | grep -v /vendor/)
.PHONY: vet
vet: ## Analyze the code
$(Q) $(GO) vet ./...
.PHONY: clean
clean: ## Clean all generated artifacts
$(Q) rm -rf $(DIST_DIR) $(TEST_DIR)