version: 2.1
jobs:
clippy:
docker: [image: cimg/rust:1.63.0]
steps:
- checkout
- run: cargo --version
- restore_cache: { key: clippy-cache }
- run: cargo clippy --workspace --all-targets --all-features
- save_cache:
key: clippy-cache
paths:
- '~/.cargo'
- './target'
test:
docker: [image: cimg/rust:1.56.0]
steps:
- checkout
- run: cargo --version
- restore_cache: { key: test-cache }
- run: >
[ -f ${CARGO_HOME:-~/.cargo/bin}/cargo-nextest ] ||
curl -LsSf https://get.nexte.st/latest/linux |
tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- run: cargo nextest run --workspace --all-targets --all-features
- save_cache:
key: test-cache
paths:
- '~/.cargo'
- './target'
doc-test:
docker: [image: cimg/rust:1.63.0]
steps:
- checkout
- run: cargo --version
- restore_cache: { key: doc-test-cache }
- run: cargo doc --workspace --all-features --no-deps
- run: cargo test --workspace --doc --all-features -- --test-threads=1
- save_cache:
key: doc-test-cache
paths:
- '~/.cargo'
- './target'
workflows:
version: 2
all_checks:
jobs: [clippy, test, doc-test]