cosmos-sdk/.circleci/config.yml

316 lines
8.1 KiB
YAML
Raw Normal View History

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:
- image: circleci/golang:1.11.1
2018-03-20 16:55:55 -07:00
environment:
GOBIN: /tmp/workspace/bin
docs_update: &docs_deploy
working_directory: ~/repo
docker:
- image: tendermint/docs_deployment
environment:
AWS_REGION: us-east-1
2018-03-20 16:55:55 -07:00
jobs:
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:
- 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
2018-04-19 05:30:14 -07:00
lint:
<<: *defaults
parallelism: 1
2018-04-19 05:30:14 -07:00
steps:
- attach_workspace:
at: /tmp/workspace
2018-08-21 14:01:17 -07:00
- checkout
- run:
name: dependencies
command: |
export PATH="$GOBIN:$PATH"
make get_vendor_deps
- run:
name: Get metalinter
command: |
export PATH="$GOBIN:$PATH"
2018-10-10 23:34:00 -07:00
make get_tools
make get_dev_tools
2018-04-19 05:30:14 -07:00
- run:
name: Lint source
command: |
export PATH="$GOBIN:$PATH"
make test_lint
integration_tests:
2018-05-31 14:45:07 -07:00
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: /tmp/workspace
2018-08-21 14:01:17 -07:00
- checkout
- run:
name: dependencies
command: |
export PATH="$GOBIN:$PATH"
make get_vendor_deps
2018-05-31 14:45:07 -07:00
- run:
name: Test cli
command: |
export PATH="$GOBIN:$PATH"
make test_cli
make test_examples
test_sim_modules:
2018-07-11 13:44:21 -07:00
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: /tmp/workspace
2018-08-21 14:01:17 -07:00
- checkout
- run:
name: dependencies
command: |
export PATH="$GOBIN:$PATH"
make get_vendor_deps
2018-07-11 13:44:21 -07:00
- run:
name: Test individual module simulations
2018-07-11 13:44:21 -07:00
command: |
export PATH="$GOBIN:$PATH"
make test_sim_modules
test_sim_gaia_nondeterminism:
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: /tmp/workspace
2018-08-21 14:01:17 -07:00
- checkout
- run:
name: dependencies
command: |
export PATH="$GOBIN:$PATH"
make get_vendor_deps
- run:
name: Test individual module simulations
command: |
export PATH="$GOBIN:$PATH"
make test_sim_gaia_nondeterminism
test_sim_gaia_fast:
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: /tmp/workspace
2018-08-21 14:01:17 -07:00
- checkout
- run:
name: dependencies
command: |
export PATH="$GOBIN:$PATH"
make get_vendor_deps
- run:
name: Test full Gaia simulation
command: |
export PATH="$GOBIN:$PATH"
make test_sim_gaia_fast
2018-07-11 13:44:21 -07:00
test_sim_gaia_import_export:
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: dependencies
command: |
export PATH="$GOBIN:$PATH"
make get_vendor_deps
- run:
name: Test Gaia import/export simulation
command: |
export PATH="$GOBIN:$PATH"
make test_sim_gaia_import_export
2018-10-05 05:33:46 -07:00
test_sim_gaia_multi_seed:
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: dependencies
command: |
export PATH="$GOBIN:$PATH"
make get_vendor_deps
- run:
name: Test multi-seed Gaia simulation
command: |
export PATH="$GOBIN:$PATH"
make test_sim_gaia_multi_seed
2018-03-20 16:55:55 -07:00
test_cover:
<<: *defaults
parallelism: 4
2018-03-20 16:55:55 -07:00
steps:
- attach_workspace:
at: /tmp/workspace
2018-08-21 14:01:17 -07:00
- checkout
- run:
name: dependencies
command: |
export PATH="$GOBIN:$PATH"
make get_vendor_deps
- 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
export VERSION="$(git describe --tags --long | sed 's/v\(.*\)/\1/')"
for pkg in $(go list github.com/cosmos/cosmos-sdk/... | grep -v github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test | grep -v '/simulation' | circleci tests split --split-by=timings); do
2018-03-20 16:55:55 -07:00
id=$(basename "$pkg")
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/*"
- store_artifacts:
path: /tmp/logs
2018-03-20 16:55:55 -07:00
upload_coverage:
<<: *defaults
parallelism: 1
2018-03-20 16:55:55 -07:00
steps:
- attach_workspace:
at: /tmp/workspace
2018-08-21 14:01:17 -07:00
- checkout
- run:
name: dependencies
command: |
export PATH="$GOBIN:$PATH"
make get_vendor_deps
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
localnet:
working_directory: /home/circleci/.go_workspace/src/github.com/cosmos/cosmos-sdk
machine:
image: circleci/classic:latest
environment:
GOBIN: /home/circleci/.go_workspace/bin
GOPATH: /home/circleci/.go_workspace/
GOOS: linux
GOARCH: amd64
parallelism: 1
steps:
- checkout
- run:
name: run localnet and exit on failure
command: |
2018-10-04 06:59:04 -07:00
pushd /tmp
wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz
sudo tar -xvf go1.11.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo mv go /usr/local
popd
set -x
make get_tools
make get_vendor_deps
make build-linux
make localnet-start
./scripts/localnet-blocks-test.sh 40 5 10 localhost
deploy_docs:
<<: *docs_deploy
steps:
- checkout
- run:
name: Trigger website build
command: |
export LAST_COMMIT=`git rev-parse HEAD`
export DOCS_COMMIT=`git log -1 --format=format:%H --full-diff docs`
if [[ $DOCS_COMMIT == $LAST_COMMIT ]]; then
chamber exec cosmos-sdk -- start_website_build
else
echo "No changes to docs detected"
fi
2018-03-20 16:55:55 -07:00
workflows:
version: 2
test-suite:
jobs:
- deploy_docs
2018-03-20 16:55:55 -07:00
- setup_dependencies
2018-04-19 05:30:14 -07:00
- lint:
requires:
- setup_dependencies
- integration_tests:
2018-05-02 20:07:05 -07:00
requires:
- setup_dependencies
- test_sim_modules:
requires:
- setup_dependencies
- test_sim_gaia_nondeterminism:
requires:
- setup_dependencies
- test_sim_gaia_fast:
2018-07-11 13:44:21 -07:00
requires:
- setup_dependencies
- test_sim_gaia_import_export:
requires:
- setup_dependencies
2018-10-05 05:41:12 -07:00
- test_sim_gaia_multi_seed:
requires:
- setup_dependencies
2018-03-20 16:55:55 -07:00
- test_cover:
requires:
- setup_dependencies
- localnet:
requires:
- setup_dependencies
2018-03-20 16:55:55 -07:00
- upload_coverage:
requires:
- test_cover