# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

orbs:
  # The Node.js orb contains a set of prepackaged CircleCI configuration you can utilize
  # Orbs reduce the amount of configuration required for common tasks.
  # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/node
  node: circleci/node@4.1

jobs:
  build-and-verify:
    docker:
      - image: cimg/node:15.1
    steps:
      - checkout
      - node/install-packages:
          pkg-manager: yarn
      - run:
          name: Install linters
          command: yarn add tslint prettify
      - run:
          name: Run tslint
          command: yarn lint
      - run:
          name: Run prettify
          command: yarn prettier-check
      - run:
          name: Run tests
          command: yarn test

workflows:
  sample:
    jobs:
      - build-and-verify
