version: 2.1

jobs:
  build:
    docker:
      - image: circleci/rust:latest
    steps:
      - checkout

      - restore_cache:
          key: mkroman-tvtid-{{ arch }}

      - run:
          name: Build in debug mode
          command: cargo build

      - persist_to_workspace:
          root: .
          paths:
            - target/*

      - save_cache:
          key: mkroman-tvtid-{{ arch }}
          paths:
            - target/debug/build
            - target/debug/deps
            - target/debug/.fingerprint

  test:
    docker:
      - image: circleci/rust:latest
    steps:
    - attach_workspace:
        at: .

    - run:
        name: Run tests
        command: cargo test

workflows:
  version: 2

  build_and_test:
    jobs:
      - build
      - test:
          requires:
            - build

version: 2.1

jobs:
  test:
    docker:
      - image: circleci/rust:latest
    steps:
      - checkout
      - run:
          name: Run tests
          command: cargo test

workflows:
  version: 2

  run-tests:
    jobs:
      - test

Remove cache from CircleCI jobs
Remove cache from CircleCI jobs
