version: 2 jobs: build: docker: - image: rust:1.64.0 - image: postgres:12 environment: POSTGRES_PASSWORD: password steps: - checkout - restore_cache: key: registry - run: cargo generate-lockfile - save_cache: key: registry-{{ epoch }} paths: - /usr/local/cargo/registry/index - restore_cache: key: dependencies-1.40-{{ checksum "Cargo.lock" }} - run: cargo test - save_cache: key: dependencies-1.40-{{ checksum "Cargo.lock" }} paths: - target - /usr/local/cargo/registry/cache