version: "2.1"
executors: {
"beta": {
"docker": [
{
"image": "liuchong/rustup:beta"
}
]
},
"nightly": {
"docker": [
{
"image": "liuchong/rustup:nightly"
}
]
},
"stable": {
"docker": [
{
"image": "liuchong/rustup:stable"
}
]
}
}
commands:
cargo_test:
description: "Run `cargo test`"
steps:
- run:
name: "Clean out rust-toolchain"
command: "rm -f rust-toolchain"
- run:
name: "Toolchain debug info"
command: "rustc --version"
- run:
name: Test
command: cargo test --verbose --all
jobs:
test:
parameters:
version:
type: executor
version_name:
type: string
executor: << parameters.version >>
environment:
CI_RUST_VERSION: << parameters.version_name >>
steps:
- checkout
- cargo_test
rustfmt:
parameters:
version:
type: executor
executor: << parameters.version >>
steps:
- checkout
- run:
name: Install
command: rustup component add rustfmt
- run:
name: Rustfmt
command: cargo fmt -v -- --check
clippy:
parameters:
version:
type: executor
executor: << parameters.version >>
steps:
- checkout
- run:
name: Install
command: rustup component add clippy
- run:
name: Clippy
command: cargo clippy -- -D warnings
bench:
parameters:
version:
type: executor
executor: << parameters.version >>
steps:
- checkout
- run:
name: Bench
command: cargo bench
no_std_stable:
parameters:
version:
type: executor
version_name:
type: string
executor: << parameters.version >>
environment:
CI_RUST_VERSION: << parameters.version_name >>
steps:
- checkout
- run:
name: cargo test --no-default-features --features no_std
command: cargo test --no-default-features --features no_std
no_std_nightly:
parameters:
version:
type: executor
version_name:
type: string
executor: << parameters.version >>
environment:
CI_RUST_VERSION: << parameters.version_name >>
steps:
- checkout
- run:
name: cargo +nightly test --no-default-features --features no_std
command: cargo +nightly test --no-default-features --features no_std
workflows:
continuous_integration:
jobs:
- test:
name: test-stable
version: stable
version_name: stable
filters: {
"branches": {
"ignore": [
"/.*\\.tmp/"
]
},
"tags": {
"only": [
"/^v\\d+\\.\\d+\\.\\d+.*$/"
]
}
}
- test:
name: test-nightly
version: nightly
version_name: nightly
filters: {
"branches": {
"ignore": [
"/.*\\.tmp/"
]
},
"tags": {
"only": [
"/^v\\d+\\.\\d+\\.\\d+.*$/"
]
}
}
- rustfmt:
version: stable
filters: {
"branches": {
"ignore": [
"/.*\\.tmp/"
]
},
"tags": {
"only": [
"/^v\\d+\\.\\d+\\.\\d+.*$/"
]
}
}
- bench:
version: nightly
filters: {
"branches": {
"ignore": [
"/.*\\.tmp/"
]
},
"tags": {
"only": [
"/^v\\d+\\.\\d+\\.\\d+.*$/"
]
}
}
- no_std_stable:
name: "no_std_stable"
version: stable
version_name: stable
- no_std_nightly:
name: "no_std_nightly"
version: nightly
version_name: nightly
scheduled_tests:
jobs:
- test:
name: test-stable
version: stable
version_name: stable
- test:
name: test-nightly
version: nightly
version_name: nightly
triggers:
- schedule:
cron: 0 0 * * 0
filters:
branches:
only: [
"master"
]