version: 2
jobs:
  build:
    docker:
      - image: circleci/node:10-browsers

    working_directory: ~/repo

    steps:
      - checkout

      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          - v1-dependencies-

      - run:
          name: Install Dependencies
          command: npm install

      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}

      - run:
          name: Run Tests
          command: npm test

      - store_artifacts:
          path: coverage/
          destination: coverage

      - store_artifacts:
          path: rendering/cases/
          destination: rendering

      - run:
          name: Build Examples
          command: npm run build-examples

      - store_artifacts:
          path: build/examples
          destination: examples

      - run:
          name: Build API Docs
          command: npm run apidoc

      - store_artifacts:
          path: build/apidoc
          destination: apidoc

version: 2
jobs:
  build:
    docker:
      - image: circleci/node:latest-browsers

    working_directory: ~/repo

    steps:
      - checkout

      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          - v1-dependencies-

      - run:
          name: Install Dependencies
          command: npm install

      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}

      - run:
          name: Run Tests
          command: npm test

      - store_artifacts:
          path: coverage/
          destination: coverage

      - store_artifacts:
          path: rendering/cases/
          destination: rendering

      - run:
          name: Build Examples
          command: npm run build-examples

      - store_artifacts:
          path: build/examples
          destination: examples

      - run:
          name: Build API Docs
          command: npm run apidoc

      - store_artifacts:
          path: build/apidoc
          destination: apidoc

Revert "Try downgrading Node for JSDoc"
Revert "Try downgrading Node for JSDoc"

This reverts commit 284c1dff83fc2ef9e03361320b403b356c13dbe3.
