# This config was automatically generated from your source code
# Stacks detected: deps:node:.,package_manager:yarn:
version: 2.1
orbs:
  node: circleci/node@5
jobs:
  lint: 
    executor: node/default
    steps:
      - checkout
      - node/install-packages:
          pkg-manager: yarn
      - run:
          command: yarn lint
  build-node:
    # Build node project
    executor: node/default
    steps:
      - checkout
      - node/install-packages:
          pkg-manager: yarn
      - run:
          command: yarn run build
  test-node:
    # Install node dependencies and run tests
    executor: node/default
    steps:
      - checkout
      - node/install-packages:
          pkg-manager: yarn
      - run:
          name: Run tests
          command: yarn test
  coveralls: 
    # update coveralls
    executor: node/default
    steps: 
      - checkout
      - node/install-packages:
          pkg-manager: yarn
      - run:
          name: Update coveralls
          command: yarn coveralls
    
workflows:
  build-and-test-and-coveralls:
    jobs:
      - lint
      - build-node:
          requires:
            - lint
      - test-node:
          requires:
            - build-node
      - coveralls:
          requires:
            - test-node
