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