version: 2


jobs:
  build:
    working_directory: ~/react-debounce-input
    docker:
      - image: circleci/node:8


    steps:
      - checkout


      - run:
          name: Update yarn
          command: sudo yarn global add yarn



      - restore_cache:
          key: deps-{{ checksum "yarn.lock" }}


      - run:
          name: Install dependencies
          command: yarn install --pure-lockfile


      - save_cache:
          key: deps-{{ checksum "yarn.lock" }}
          paths:
            - node_modules


      - run:
          name: Lint
          command: $(yarn bin)/eslint .


      - run:
          name: Test
          command: NODE_ENV=test $(yarn bin)/babel-node $(yarn bin)/babel-istanbul cover --report text --report lcov --verbose --dir ./coverage ./test


      - run:
          name: End-to-end Smoketest
          command: REPORT_DIR=./coverage LOG_DIR=./coverage NODE_ENV=development $(yarn bin)/nightwatch-autorun


      - deploy:
          name: Codecov
          command: cat ./coverage/lcov.info | $(yarn bin)/codecov


      - store_artifacts:
          path: ./coverage
          destination: coverage

version: 2


jobs:
  build:
    working_directory: ~/react-debounce-input
    docker:
      - image: circleci/node:8


    steps:
      - checkout


      - run:
          name: Update yarn
          command: sudo yarn global add yarn



      - restore_cache:
          key: deps-{{ checksum "yarn.lock" }}


      - run:
          name: Install dependencies
          command: yarn install --pure-lockfile


      - save_cache:
          key: deps-{{ checksum "yarn.lock" }}
          paths:
            - node_modules


      - run:
          name: Lint
          command: $(yarn bin)/eslint .


      - run:
          name: Test
          command: NODE_ENV=test $(yarn bin)/babel-node $(yarn bin)/babel-istanbul cover --report text --report lcov --verbose --dir ./coverage ./test


#      - run:
#          name: End-to-end Smoketest
#          command: REPORT_DIR=./coverage LOG_DIR=./coverage NODE_ENV=development $(yarn bin)/nightwatch-autorun


      - deploy:
          name: Codecov
          command: cat ./coverage/lcov.info | $(yarn bin)/codecov


      - store_artifacts:
          path: ./coverage
          destination: coverage

Disable e2e tests for now
Disable e2e tests for now
