generated from mrz1836/go-template
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
52 lines (42 loc) · 1.74 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
# Set the custom build tags
GO_BUILD_TAGS=json1
# Common makefile commands & variables between projects
include .make/common.mk
# Common Golang makefile commands & variables between projects
include .make/go.mk
## Not defined? Use default repo name which is the application
ifeq ($(REPO_NAME),)
REPO_NAME="spv-wallet"
endif
## Not defined? Use default repo owner
ifeq ($(REPO_OWNER),)
REPO_OWNER="bitcoin-sv"
endif
.PHONY: all
all: ## Runs multiple commands
@$(MAKE) lint
@$(MAKE) test-all-db
.PHONY: clean
clean: ## Remove previous builds and any cached data
@echo "cleaning local cache..."
@go clean -cache -testcache -i -r
@$(MAKE) clean-mods
@test $(DISTRIBUTIONS_DIR)
@if [ -d $(DISTRIBUTIONS_DIR) ]; then rm -r $(DISTRIBUTIONS_DIR); fi
.PHONY: release
release:: ## Runs common.release then runs godocs
@$(MAKE) godocs
.PHONY: test-all-db
test-all-db: ## Runs all tests including embedded database tests
@echo "running all tests including embedded database tests..."
@go test ./... -v -tags="$(GO_BUILD_TAGS) database_tests"
cd engine/ && go test ./... -v -tags="$(GO_BUILD_TAGS) database_tests"
cd models/ && go test ./... -v -tags="$(GO_BUILD_TAGS) database_tests"
.PHONY: test-all-db-ci
test-all-db-ci: ## Runs all tests including embedded database tests (CI)
@echo "running all tests including embedded database tests..."
@go test ./... -coverprofile=coverage.txt -covermode=atomic -tags="$(GO_BUILD_TAGS) database_tests"
cd engine/ && go test ./... -coverprofile=coverage.txt -covermode=atomic -tags="$(GO_BUILD_TAGS) database_tests"
cd models/ && go test ./... -coverprofile=coverage.txt -covermode=atomic -tags="$(GO_BUILD_TAGS) database_tests"
tail -n +2 models/coverage.txt >> coverage.txt
tail -n +2 engine/coverage.txt >> coverage.txt