version: 2
jobs:
  build:
    working_directory: ~/impress.js
    docker:
      - image: circleci/node:current-browsers
    steps:
      - checkout
      - run:
          name: update-npm
          command: 'sudo npm install -g npm@latest'
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: install-npm
          command: npm install
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - ./node_modules
      - run:
          name: build
          command: npm run build
      - run:
          name: lint
          command: npm run lint
      - run:
          name: test
          command: npm test
