# Cache key definitions
cache-node-modules: &cache-node-modules
  key: node-modules-cache-{{ checksum "package.json" }}

version: 2
jobs:
  build:
    working_directory: ~/eslint-plugin-turbopatent
    docker:
      - image: circleci/node:12-stretch
    steps:
      - checkout
      - restore_cache:
          <<: *cache-node-modules
      - run:
          name: yarn
          command: |
            [ -d node_modules ] || yarn
      - save_cache:
          <<: *cache-node-modules
          paths:
            - node_modules
      - run: yarn test
