1restore_registry: &RESTORE_REGISTRY 2 restore_cache: 3 key: registry 4save_registry: &SAVE_REGISTRY 5 save_cache: 6 key: registry-{{ .BuildNum }} 7 paths: 8 - /usr/local/cargo/registry/index 9deps_key: &DEPS_KEY 10 key: deps-{{ checksum "~/rust-version" }}-{{ checksum "Cargo.lock" }} 11restore_deps: &RESTORE_DEPS 12 restore_cache: 13 <<: *DEPS_KEY 14save_deps: &SAVE_DEPS 15 save_cache: 16 <<: *DEPS_KEY 17 paths: 18 - target 19 - /usr/local/cargo/registry/cache 20 21version: 2 22jobs: 23 build: 24 working_directory: ~/build 25 docker: 26 - image: rust:1.19.0 27 environment: 28 RUSTFLAGS: -D warnings 29 steps: 30 - checkout 31 - *RESTORE_REGISTRY 32 - run: cargo generate-lockfile 33 - *SAVE_REGISTRY 34 - run: rustc --version > ~/rust-version 35 - *RESTORE_DEPS 36 - run: cargo test 37 - run: cargo test --features std 38 - *SAVE_DEPS 39