version: 2
jobs:
  build:
    docker:
      - image: circleci/node:6.15.1-browsers-legacy
    steps:
      - checkout
      - restore_cache:
          name: Restore Yarn Package Cache
          keys:
            - yarn-packages-{{ checksum "yarn.lock" }}
      - run:
          name: Install Dependencies
          command: yarn install --frozen-lockfile
      - save_cache:
          name: Save Yarn Package Cache
          key: yarn-packages-{{ checksum "yarn.lock" }}
          paths:
            - ~/.cache/yarn
      - run:
          name: Run Linter
          command: yarn lint
      - run:
          name: Run tests
          command: yarn test
      - run:
          name: Report code coverage
          command: yarn report-coverage