version: 2 jobs: build: working_directory: ~/build docker: - image: jimmycuadra/rust:1.19.0 - image: postgres:9.6 environment: POSTGRES_PASSWORD: password steps: - checkout - restore_cache: key: registry - run: cargo generate-lockfile - save_cache: key: registry-{{ epoch }} paths: - ~/.cargo/registry/index - restore_cache: key: dependencies-1.19-{{ checksum "Cargo.lock" }} - run: cargo test - save_cache: key: dependencies-1.19-{{ checksum "Cargo.lock" }} paths: - target - ~/.cargo/registry/cache