version: 2
jobs:
  checkout_code:
    executor: rn/linux_js
    steps:
      - checkout
      - persist_to_workspace:
          root: .
          paths: .

  javascript:
    docker:
      - image: circleci/node:lts
    working_directory: ~/eslint-plugin-import-groups
    steps:
      - yarn lint
      - yarn build:analyze
      - persist_to_workspace:
          root: .
          paths: .

  test_cypress:
    docker:
      - image: cypress/base:8
        environment:
          ## this enables colors in the output
          TERM: xterm
    working_directory: ~/app

    steps:
      - checkout
      - restore_cache:
          keys:
            - v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
            - v1-deps-{{ .Branch }}
            - v1-deps
      - run:
          name: Install Dependencies
          command: yarn
      - save_cache:
          key: v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
          paths:
            - ~/.npm
            - ~/.cache
      - run: yarn workspace docs build
      - run: yarn workspace docs start & npx wait-on http://localhost:3000 && npm run e2e:run -- --record

workflows:
  version: 2
  build_and_test:
    jobs:
      - checkout_code
      - javascript:
          requires:
            - checkout_code

      - test_cypress:
          requires:
            - javascript

version: 2
jobs:
  checkout_code:
    docker:
      - image: circleci/node:lts
    steps:
      - checkout
      - persist_to_workspace:
          root: .
          paths: .

  javascript:
    docker:
      - image: circleci/node:lts
    working_directory: ~/eslint-plugin-import-groups
    steps:
      - yarn lint
      - yarn build:analyze
      - persist_to_workspace:
          root: .
          paths: .

  test_cypress:
    docker:
      - image: cypress/base:8
        environment:
          ## this enables colors in the output
          TERM: xterm
    working_directory: ~/app

    steps:
      - checkout
      - restore_cache:
          keys:
            - v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
            - v1-deps-{{ .Branch }}
            - v1-deps
      - run:
          name: Install Dependencies
          command: yarn
      - save_cache:
          key: v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
          paths:
            - ~/.npm
            - ~/.cache
      - run: yarn workspace docs build
      - run: yarn workspace docs start & npx wait-on http://localhost:3000 && npm run e2e:run -- --record

workflows:
  version: 2
  build_and_test:
    jobs:
      - checkout_code
      - javascript:
          requires:
            - checkout_code

      - test_cypress:
          requires:
            - javascript

Use docker for checkouting coce
Use docker for checkouting coce
