Skip to content
This repository has been archived by the owner on Jul 4, 2022. It is now read-only.

Commit

Permalink
break the main circleci job into two
Browse files Browse the repository at this point in the history
* break the main build job into build-bin and build-test-and-run
* use workflow to run them in parallel
* refactor some inline runs as commands
* add 30 min timeout period for running tests
  • Loading branch information
cowboy-bebug authored Dec 23, 2019
1 parent 0966e9d commit 0c18345
Showing 1 changed file with 48 additions and 14 deletions.
62 changes: 48 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,29 @@ commands:
- restore_cache:
name: Restore target cache
key: target-cache-{{ arch }}-{{ checksum ".circleci/RUST_VERSION" }}-{{ .Environment.CIRCLE_BRANCH }}
cargo-check:
steps:
- run:
name: Build
command: cargo check
no_output_timeout: 30m
cargo-build-test:
steps:
- run:
command: cargo test --no-run --release --all
no_output_timeout: 30m
cargo-run-test:
steps:
- run:
command: cargo test --release --all
no_output_timeout: 30m
jobs:
build:
machine:
image: ubuntu-1604:201903-01
steps:
- run: echo "successfully built and tested"
build-bin:
machine:
image: ubuntu-1604:201903-01
resource_class: large
Expand All @@ -73,19 +94,32 @@ jobs:
- install-rust
- install-sccache
- restore-cache
- run:
name: Build
command: |
cargo check
no_output_timeout: 30m
- cargo-check
- save-cache
- run:
name: Build tests
command: |
cargo test --no-run --release --all
no_output_timeout: 30m
build-test-and-run:
machine:
image: ubuntu-1604:201903-01
resource_class: large
environment:
BASH_ENV: ~/.cargo/env
RUST_VERSION: stable-2019-11-07
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 10G
steps:
- checkout
- install-rust
- install-sccache
- restore-cache
- cargo-build-test
- save-cache
- run:
name: Run tests
command: |
cargo test --release --all
- cargo-run-test
workflows:
version: 2
build-test-publish:
jobs:
- build-bin
- build-test-and-run
- build:
requires:
- build-bin
- build-test-and-run

0 comments on commit 0c18345

Please sign in to comment.