circle/makefile upgraaade
This commit is contained in:
parent
9ccee0770f
commit
e970dce841
|
@ -68,6 +68,38 @@ jobs:
|
||||||
export PATH="$GOBIN:$PATH"
|
export PATH="$GOBIN:$PATH"
|
||||||
gometalinter --disable-all --enable='golint' --vendor ./...
|
gometalinter --disable-all --enable='golint' --vendor ./...
|
||||||
|
|
||||||
|
test_unit:
|
||||||
|
<<: *defaults
|
||||||
|
parallelism: 4
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: /tmp/workspace
|
||||||
|
- restore_cache:
|
||||||
|
key: v1-pkg-cache
|
||||||
|
- restore_cache:
|
||||||
|
key: v1-tree-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
|
- run:
|
||||||
|
name: Test unit
|
||||||
|
command: |
|
||||||
|
export PATH="$GOBIN:$PATH"
|
||||||
|
make test_unit
|
||||||
|
|
||||||
|
test_cli:
|
||||||
|
<<: *defaults
|
||||||
|
parallelism: 1
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: /tmp/workspace
|
||||||
|
- restore_cache:
|
||||||
|
key: v1-pkg-cache
|
||||||
|
- restore_cache:
|
||||||
|
key: v1-tree-{{ .Environment.CIRCLE_SHA1 }}
|
||||||
|
- run:
|
||||||
|
name: Test cli
|
||||||
|
command: |
|
||||||
|
export PATH="$GOBIN:$PATH"
|
||||||
|
make test_cli
|
||||||
|
|
||||||
test_cover:
|
test_cover:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
parallelism: 4
|
parallelism: 4
|
||||||
|
@ -121,6 +153,12 @@ workflows:
|
||||||
- lint:
|
- lint:
|
||||||
requires:
|
requires:
|
||||||
- setup_dependencies
|
- setup_dependencies
|
||||||
|
- test_unit:
|
||||||
|
requires:
|
||||||
|
- setup_dependencies
|
||||||
|
- test_cli:
|
||||||
|
requires:
|
||||||
|
- setup_dependencies
|
||||||
- test_cover:
|
- test_cover:
|
||||||
requires:
|
requires:
|
||||||
- setup_dependencies
|
- setup_dependencies
|
||||||
|
|
22
Makefile
22
Makefile
|
@ -1,13 +1,14 @@
|
||||||
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
|
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
|
||||||
|
PACKAGES_NOCLITEST=$(shell go list ./... | grep -v '/vendor/' | grep -v github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test)
|
||||||
COMMIT_HASH := $(shell git rev-parse --short HEAD)
|
COMMIT_HASH := $(shell git rev-parse --short HEAD)
|
||||||
BUILD_FLAGS = -ldflags "-X github.com/cosmos/cosmos-sdk/version.GitCommit=${COMMIT_HASH}"
|
BUILD_FLAGS = -ldflags "-X github.com/cosmos/cosmos-sdk/version.GitCommit=${COMMIT_HASH}"
|
||||||
|
|
||||||
all: check_tools get_vendor_deps build build_examples install install_examples test_nocli
|
all: check_tools get_vendor_deps install install_examples test_lint test
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
### CI
|
### CI
|
||||||
|
|
||||||
ci: get_tools get_vendor_deps install test_cover
|
ci: get_tools get_vendor_deps install test_cover test_lint test
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
### Build
|
### Build
|
||||||
|
@ -83,18 +84,13 @@ godocs:
|
||||||
########################################
|
########################################
|
||||||
### Testing
|
### Testing
|
||||||
|
|
||||||
test: test_unit # test_cli
|
test: test_unit test_cli
|
||||||
|
|
||||||
test_nocli:
|
test_cli:
|
||||||
go test `go list ./... | grep -v github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test`
|
@go test -count 1 -p 1 `go list github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test`
|
||||||
|
|
||||||
# Must be run in each package seperately for the visualization
|
|
||||||
# Added here for easy reference
|
|
||||||
# coverage:
|
|
||||||
# go test -coverprofile=c.out && go tool cover -html=c.out
|
|
||||||
|
|
||||||
test_unit:
|
test_unit:
|
||||||
@go test $(PACKAGES)
|
@go test $(PACKAGES_NOCLITEST)
|
||||||
|
|
||||||
test_cover:
|
test_cover:
|
||||||
@bash tests/test_cover.sh
|
@bash tests/test_cover.sh
|
||||||
|
@ -103,7 +99,7 @@ test_lint:
|
||||||
gometalinter --disable-all --enable='golint' --vendor ./...
|
gometalinter --disable-all --enable='golint' --vendor ./...
|
||||||
|
|
||||||
benchmark:
|
benchmark:
|
||||||
@go test -bench=. $(PACKAGES)
|
@go test -bench=. $(PACKAGES_NOCLITEST)
|
||||||
|
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
|
@ -133,4 +129,4 @@ devdoc_update:
|
||||||
# To avoid unintended conflicts with file names, always add to .PHONY
|
# To avoid unintended conflicts with file names, always add to .PHONY
|
||||||
# unless there is a reason not to.
|
# unless there is a reason not to.
|
||||||
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
|
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
|
||||||
.PHONY: build build_examples install install_examples dist check_tools get_tools get_vendor_deps draw_deps test test_nocli test_unit test_cover test_lint benchmark devdoc_init devdoc devdoc_save devdoc_update
|
.PHONY: build build_examples install install_examples dist check_tools get_tools get_vendor_deps draw_deps test test_cli test_unit test_cover test_lint benchmark devdoc_init devdoc devdoc_save devdoc_update
|
||||||
|
|
Loading…
Reference in New Issue