2018-05-31 19:03:40 -07:00
version : 2
2018-03-20 16:55:55 -07:00
defaults : &defaults
working_directory : /go/src/github.com/cosmos/cosmos-sdk
docker :
2018-06-15 20:36:01 -07:00
- image : circleci/golang:1.10.3
2018-03-20 16:55:55 -07:00
environment :
GOBIN : /tmp/workspace/bin
jobs :
2018-06-30 16:32:52 -07:00
2018-03-20 16:55:55 -07:00
setup_dependencies :
<< : *defaults
steps :
- run : mkdir -p /tmp/workspace/bin
- run : mkdir -p /tmp/workspace/profiles
- checkout
- restore_cache :
keys :
2018-06-16 00:49:55 -07:00
- v1-pkg-cache
2018-03-20 16:55:55 -07:00
- run :
name : tools
command : |
export PATH="$GOBIN:$PATH"
make get_tools
- run :
name : dependencies
command : |
export PATH="$GOBIN:$PATH"
make get_vendor_deps
- run :
name : binaries
command : |
export PATH="$GOBIN:$PATH"
2018-04-18 10:23:47 -07:00
make install
2018-05-21 12:18:56 -07:00
make install_examples
2018-03-20 16:55:55 -07:00
- persist_to_workspace :
root : /tmp/workspace
paths :
- bin
- profiles
- save_cache :
2018-06-16 00:49:55 -07:00
key : v1-pkg-cache
2018-03-20 16:55:55 -07:00
paths :
- /go/pkg
- save_cache :
2018-06-16 00:49:55 -07:00
key : v1-tree-{{ .Environment.CIRCLE_SHA1 }}
2018-03-20 16:55:55 -07:00
paths :
- /go/src/github.com/cosmos/cosmos-sdk
2018-04-19 05:30:14 -07:00
lint :
<< : *defaults
2018-06-22 13:58:48 -07:00
parallelism : 1
2018-04-19 05:30:14 -07:00
steps :
- attach_workspace :
at : /tmp/workspace
- restore_cache :
2018-06-16 00:49:55 -07:00
key : v1-pkg-cache
2018-04-19 05:30:14 -07:00
- restore_cache :
2018-06-16 00:49:55 -07:00
key : v1-tree-{{ .Environment.CIRCLE_SHA1 }}
2018-06-13 11:02:08 -07:00
- run :
name : Get metalinter
command : |
export PATH="$GOBIN:$PATH"
2018-07-18 01:20:24 -07:00
make get_dev_tools
2018-04-19 05:30:14 -07:00
- run :
name : Lint source
command : |
export PATH="$GOBIN:$PATH"
2018-06-27 17:32:06 -07:00
make test_lint
2018-06-22 13:08:50 -07:00
2018-05-31 14:45:07 -07:00
test_cli :
<< : *defaults
parallelism : 1
steps :
- attach_workspace :
at : /tmp/workspace
- restore_cache :
2018-06-16 00:49:55 -07:00
key : v1-pkg-cache
2018-05-31 14:45:07 -07:00
- restore_cache :
2018-06-16 00:49:55 -07:00
key : v1-tree-{{ .Environment.CIRCLE_SHA1 }}
2018-05-31 14:45:07 -07:00
- run :
name : Test cli
command : |
export PATH="$GOBIN:$PATH"
2018-07-02 21:33:53 -07:00
make test_cli
2018-06-22 13:08:50 -07:00
2018-07-11 13:44:21 -07:00
test_sim :
<< : *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 simulation
command : |
export PATH="$GOBIN:$PATH"
2018-07-18 00:37:14 -07:00
export GAIA_SIMULATION_SEED=1531897442166404087
2018-07-11 13:44:21 -07:00
make test_sim
2018-03-20 16:55:55 -07:00
test_cover :
<< : *defaults
2018-07-13 13:46:14 -07:00
parallelism : 4
2018-03-20 16:55:55 -07:00
steps :
- attach_workspace :
at : /tmp/workspace
- restore_cache :
2018-06-16 00:49:55 -07:00
key : v1-pkg-cache
2018-03-20 16:55:55 -07:00
- restore_cache :
2018-06-16 00:49:55 -07:00
key : v1-tree-{{ .Environment.CIRCLE_SHA1 }}
2018-06-30 16:32:52 -07:00
- run : mkdir -p /tmp/logs
2018-03-20 16:55:55 -07:00
- run :
name : Run tests
command : |
2018-04-18 10:23:47 -07:00
export PATH="$GOBIN:$PATH"
make install
2018-07-29 14:12:38 -07:00
for pkg in $(go list github.com/cosmos/cosmos-sdk/... | grep -v github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test | circleci tests split --split-by=timings); do
2018-03-20 16:55:55 -07:00
id=$(basename "$pkg")
2018-07-29 14:12:38 -07:00
GOCACHE=off go test -timeout 8m -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic "$pkg" | tee "/tmp/logs/$id-$RANDOM.log"
2018-03-20 16:55:55 -07:00
done
- persist_to_workspace :
root : /tmp/workspace
paths :
- "profiles/*"
2018-06-30 16:32:52 -07:00
- store_artifacts :
path : /tmp/logs
2018-03-20 16:55:55 -07:00
upload_coverage :
<< : *defaults
2018-06-29 20:34:55 -07:00
parallelism : 1
2018-03-20 16:55:55 -07:00
steps :
- attach_workspace :
at : /tmp/workspace
- restore_cache :
2018-06-16 00:49:55 -07:00
key : v1-tree-{{ .Environment.CIRCLE_SHA1 }}
2018-03-20 16:55:55 -07:00
- run :
name : gather
command : |
set -ex
echo "mode: atomic" > coverage.txt
for prof in $(ls /tmp/workspace/profiles/); do
tail -n +2 /tmp/workspace/profiles/"$prof" >> coverage.txt
done
- run :
name : upload
command : bash <(curl -s https://codecov.io/bash) -f coverage.txt
workflows :
version : 2
test-suite :
jobs :
- setup_dependencies
2018-04-19 05:30:14 -07:00
- lint :
requires :
- setup_dependencies
2018-05-31 15:39:42 -07:00
- test_cli :
2018-05-02 20:07:05 -07:00
requires :
- setup_dependencies
2018-07-11 13:44:21 -07:00
- test_sim :
requires :
- setup_dependencies
2018-03-20 16:55:55 -07:00
- test_cover :
requires :
- setup_dependencies
- upload_coverage :
requires :
- test_cover