version: 2.1

jobs:
  test:
    docker:
      - image: cimg/node:15.1
    steps:
      - checkout
      - restore_cache:
          name: Restore Yarn Package Cache
          keys:
            - aurora-packages-{{ checksum "yarn.lock" }}
      - run:
          name: Install Dependencies
          command: yarn install --immutable
      - save_cache:
          name: Save Yarn Package Cache
          key: aurora-packages-{{ checksum "yarn.lock" }}
          paths:
            - ~/.cache/yarn
      - run:
          name: Run Tests
          command: yarn test:unit
      - run:
          name: Run Build
          command: yarn build

workflows:
  ci-checks:
    jobs:
      - test
