# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
  build:
    docker:
      # specify the version you desire here
      - image: circleci/node:10-stretch-browsers
      
      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # - image: circleci/mongo:3.4.4

    working_directory: ~/graphql-genie

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}

      - run: npm install
      - run: npm run installPluginDevDependencies

      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - node_modules
        
      # run tests!
      - run: npm run test
      - run: npm run lint-no-fix
