version: 2
jobs:
  build:
    docker:
      - image: node:lts
    steps:
      - checkout
      - restore_cache:
          key: dependencies-{{ checksum "package.json" }}
      - run: npm install
      - save_cache:
          key: dependencies-{{ checksum "package.json" }}-{{ .BuildNum }}
          paths:
            - node_modules
      - run: npm test
      - store_test_results:
          path: test-results
      - store_artifacts:
          path: test-results
      - store_artifacts:
          path: coverage

notify:
  webhooks:
    - url: http://bot.ambassify.com/publish/circleci/master
