version: 2
jobs:
  build_and_test:
    working_directory: ~/project
    docker:
      - image: node:12
    steps:
      - checkout
      - restore_cache:
          name: Restore Yarn Package Cache
          keys:
            - yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
            - yarn-packages-{{ .Branch }}
            - yarn-packages-master
            - yarn-packages-
      - run:
          name: Packager Version
          command: yarn --version
      - run:
          name: Install Dependencies
          command: yarn
      - save_cache:
          name: Save Yarn Package Cache
          key: yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
          paths:
            - node_modules/
      - run:
          name: Lint sources
          command: yarn lint
      - run:
          name: Test
          command: yarn test

workflows:
  version: 2
  build_and_test:
    jobs:
      - build_and_test

version: 2
jobs:
  build_and_test:
    working_directory: ~/project
    docker:
      - image: node:12
    steps:
      - checkout
      - restore_cache:
          name: Restore Yarn Package Cache
          keys:
            - yarn-packages-{{ checksum "yarn.lock" }}
      - run:
          name: Packager Version
          command: yarn --version
      - run:
          name: Install Dependencies
          command: yarn
      - save_cache:
          name: Save Yarn Package Cache
          key: yarn-packages-{{ checksum "yarn.lock" }}
          paths:
            - node_modules/
      - run:
          name: Lint sources
          command: yarn lint
      - run:
          name: Test
          command: yarn test

workflows:
  version: 2
  build_and_test:
    jobs:
      - build_and_test

Use same checksum for CI cache across branches
:new: Use same checksum for CI cache across branches
