# run locally: 
# $ circleci local execute --job build

version: 2
jobs:
  build:
    docker:
      # A simple Elm 0.19 docker - https://github.com/simonh1000/docker-elm
      - image: hotbelgo/docker-elm

    working_directory: ~/repo

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      - run: npm install create-elm-app
      - run: npm install

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

      - run: PATH="$(npm bin):$PATH" elm-app build

workflows:
  version: 2
  build_and_test:
    jobs:
      - build
