Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Circle CI #341

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
version: 2.1

executors:
rust-nightly-executor:
docker:
- image: iteringops/darwinia-builder:latest
working_directory: /darwinia


jobs:
build:
executor: rust-nightly-executor
steps:
- checkout
- restore_cache:
key: project-cache
- run:
command: |
echo 'export TARGET="native"' >> $BASH_ENV
echo 'export RUST_TOOLCHAIN="nightly"' >> $BASH_ENV
df -h
.maintain/ci/build_script.sh
- save_cache:
key: project-cache
paths:
- "~/.cargo"
- run: echo "OK" > /darwinia/target/darwinia-cache-test
- run: mv /darwinia/target /tmp
- persist_to_workspace:
root: /tmp
paths:
- target

ring test:
executor: rust-nightly-executor
steps:
- attach_workspace:
at: /tmp

- run: |
cp -r /tmp/target /darwinia
if [[ `cat /darwinia/target/darwinia-cache-test` == "OK" ]]; then
echo "workspace cache ready";
else
echo "workspace cache fail"; exit 1
fi
echo 'export TARGET="native"' >> $BASH_ENV
.maintain/ci/darwinia_test_script.sh ring

staking test:
executor: rust-nightly-executor
steps:
- attach_workspace:
at: /tmp

- run: |
cp -r /tmp/target /workspace
if [[ `cat /workspace/target/workspace-cache-test` == "OK" ]]; then
echo "workspace cache ready";
else
echo "workspace cache fail"; exit 1
fi
echo 'export TARGET="native"' >> $BASH_ENV
.maintain/ci/darwinia_test_script.sh staking

eth-relay test:
executor: rust-nightly-executor
steps:
- attach_workspace:
at: /tmp

- run: |
cp -r /tmp/target /workspace
if [[ `cat /workspace/target/workspace-cache-test` == "OK" ]]; then
echo "workspace cache ready";
else
echo "workspace cache fail"; exit 1
fi
echo 'export TARGET="native"' >> $BASH_ENV
.maintain/ci/darwinia_test_script.sh eth-relay

eth-backing test:
executor: rust-nightly-executor
steps:
- attach_workspace:
at: /tmp

- run: |
cp -r /tmp/target /workspace
if [[ `cat /workspace/target/workspace-cache-test` == "OK" ]]; then
echo "workspace cache ready";
else
echo "workspace cache fail"; exit 1
fi
echo 'export TARGET="native"' >> $BASH_ENV
.maintain/ci/darwinia_test_script.sh eth-backing

overall test:
executor: rust-nightly-executor
steps:
- attach_workspace:
at: /tmp

- run: |
cp -r /tmp/target /workspace
if [[ `cat /workspace/target/workspace-cache-test` == "OK" ]]; then
echo "workspace cache ready";
else
echo "workspace cache fail"; exit 1
fi
echo 'export TARGET="native"' >> $BASH_ENV
.maintain/ci/darwinia_test_script.sh

workflows:
version: 2

btd:
jobs:
- build
- ring test:
requires:
- build
- ring test:
requires:
- build
- staking test:
requires:
- build
- eth-relay test:
requires:
- build
- eth-backing test:
requires:
- build
- overall test:
requires:
- staking test
49 changes: 22 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,38 @@ jobs:
- stage: Check & Prepare
script: .maintain/ci/fmt_script.sh

- stage: Build
env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native
script: .maintain/ci/build_script.sh

- stage: Build
env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=wasm
script: .maintain/ci/build_script.sh

- stage: Darwinia Test
env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native KTON
script: .maintain/ci/darwinia_test_script.sh kton
# TODO: following tests are moved to circle ci
# - stage: Build
# env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native
# script: .maintain/ci/build_script.sh

- stage: Darwinia Test
env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native RING
script: .maintain/ci/darwinia_test_script.sh ring
# - stage: Darwinia Test
# env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native RING
# script: .maintain/ci/darwinia_test_script.sh ring

- stage: Darwinia Test
env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native STAKING
script: .maintain/ci/darwinia_test_script.sh staking
# - stage: Darwinia Test
# env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native STAKING
# script: .maintain/ci/darwinia_test_script.sh staking

- stage: Darwinia Test
env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native TREASURY
script: .maintain/ci/darwinia_test_script.sh treasury
# - stage: Darwinia Test
# env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native TREASURY
# script: .maintain/ci/darwinia_test_script.sh treasury

- stage: Darwinia Test
env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native ETHRELAY
script: .maintain/ci/darwinia_test_script.sh eth-relay
# - stage: Darwinia Test
# env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native ETHRELAY
# script: .maintain/ci/darwinia_test_script.sh eth-relay

- stage: Darwinia Test
env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native ETHBACKING
script: .maintain/ci/darwinia_test_script.sh eth-backing
# - stage: Darwinia Test
# env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native ETHBACKING
# script: .maintain/ci/darwinia_test_script.sh eth-backing

# TODO: remove this when overall test case ready
allow_failures:
- stage: Overall Test
env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native
script: .maintain/ci/test_script.sh
# - stage: Overall Test
# env: RUST_TOOLCHAIN=nightly-2020-02-07 TARGET=native
# script: .maintain/ci/test_script.sh

after_script:
# Check how much free disk space left after the build
Expand Down