version: 2
jobs:
  build:
    working_directory: ~/react-webpack-skeleton
    docker:
      - image: circleci/node:8.1.2
    steps:
      - checkout
      - restore_cache:
          key: v1-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
      - run:
          name: Install dependencies
          command: npm install
      - save_cache:
          key: v1-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
          paths:
            - node_modules
      - run:
          name: Build assets
          command: npm run build
      - run:
          name: Run tests
          command: npm test

version: 2
jobs:
  build:
    working_directory: ~/react-webpack-skeleton
    docker:
      - image: circleci/node:8.1.2
    steps:
      - checkout
      - restore_cache:
          key: v1-yarn-{{ .Branch }}-{{ checksum "yarn.lock" }}
      - run:
          name: Install dependencies
          command: yarn install
      - save_cache:
          key: v1-yarn-{{ .Branch }}-{{ checksum "yarn.lock" }}
          paths:
            - node_modules
      - run:
          name: Build assets
          command: yarn build
      - run:
          name: Run tests
          command: yarn test

Use Yarn in CircleCI 2.0 build instead of NPM
Use Yarn in CircleCI 2.0 build instead of NPM
