version: 2
general:
branches:
only:
- master
jobs:
build:
docker:
- image: circleci/rust:latest
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- run:
name: Calculate dependencies
command: cargo generate-lockfile
- restore_cache:
keys:
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Build all targets
command: cargo build --all --all-targets
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Run all tests
command: cargo test --all
workflows:
version: 2
build-deploy:
jobs:
- build