<commit_before>version: 2

workflows:
  version: 2
  build:
    jobs:
      - install_and_build
      - lint:
          requires:
            - install_and_build
      - deploy:
          requires:
            - install_and_build
            - lint
          filters:
            branches:
              only:
                - master
                - dev

jobs:
  install_and_build:
    working_directory: ~/stockflux
    docker:
      - image: circleci/node:10.15.1
    steps:
      - checkout:
          path: ~/stockflux
      - run:
          name: Root package install
          command: npm ci
      - run:
          name: Bootstrap packages
          command: npm run bootstrap
      - run:
          name: Build packages
          command: npm run build
      - save_cache:
          key: node_modules
          paths:
            - ./node_modules
      - persist_to_workspace:
          root: ~/stockflux
          paths: .

  lint:
    working_directory: ~/stockflux
    docker:
      - image: circleci/node:10.15.1
    steps:
      - checkout:
          path: ~/stockflux
      - restore_cache:
          key: node_modules
      - run:
          name: Lint *.js files
          command: npm run lint

  deploy:
    working_directory: ~/stockflux
    docker:
      - image: circleci/python:3.7.2
    steps:
      - attach_workspace:
          at: ~/stockflux
      - add_ssh_keys:
          fingerprints:
            - 'fc00:db20:35b:7399::5:60:4a:c7:b1:23:33:0c:07'
            - '16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48' # GitHub RSA
            - 'ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c' # GitHub DSA
      - run:
          name: Add GitHub SSH fingerprints to known hosts
          command: |
            # https://serverfault.com/questions/447028/non-interactive-git-clone-ssh-fingerprint-prompt
            # Grabbed GitHub's public key by running ssh-keyscan github.com
            # locally and directing it to the github_key file. Adding this key
            # to known hosts (creating it if it doesn't exist) prevents the
            # prompt that warns about the authenticity of the host when trying<commit_msg>Split circleci jobs into install, lint, build and deploy<commit_after>version: 2

workflows:
  version: 2
  build:
    jobs:
      - install
      - lint:
          requires:
            - install
      - build:
          requires:
            - install
      - deploy:
          requires:
            - install
            - lint
            - build
          filters:
            branches:
              only:
                - master
                - dev

jobs:
  install:
    working_directory: ~/stockflux
    docker:
      - image: circleci/node:10.15.1
    steps:
      - checkout:
          path: ~/stockflux
      - run:
          name: Root package install
          command: npm ci
      - save_cache:
          key: node_modules
          paths:
            - ./node_modules
      - persist_to_workspace:
          root: ~/stockflux
          paths: .

  lint:
    working_directory: ~/stockflux
    docker:
      - image: circleci/node:10.15.1
    steps:
      - checkout:
          path: ~/stockflux
      - restore_cache:
          key: node_modules
      - run:
          name: Lint *.js files
          command: npm run lint

  build:
    working_directory: ~/stockflux
    docker:
      - image: circleci/node:10.15.1
    steps:
      - checkout:
          path: ~/stockflux
      - restore_cache:
          key: node_modules
      - run:
          name: Bootstrap packages
          command: npm run bootstrap
      - run:
          name: Build packages
          command: npm run build
      - persist_to_workspace:
          root: ~/stockflux
          paths: .

  deploy:
    working_directory: ~/stockflux
    docker:
      - image: circleci/python:3.7.2
    steps:
      - attach_workspace:
          at: ~/stockflux
      - add_ssh_keys:
          fingerprints:
            - 'fc00:db20:35b:7399::5:60:4a:c7:b1:23:33:0c:07'
            - 'fc00:db20:35b:7399::5:63:1b:56:4d:eb:df:a6:48' # GitHub RSA
            - 'ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c' # GitHub DSA
      - run:
          name: Add GitHub SSH fingerprints to known hosts
          command: |
            # https://serverfault.com/questions/447028/non-interactive-git-clone-ssh-fingerprint-prompt
            # Grabbed GitHub's public key by running ssh-keyscan github.com
            # locally and directing it to the github_key file. Adding this key
            # to known hosts (creating it if it doesn't exist) prevents the
            # prompt that warns about the authenticity of the host when trying
{'fraction_non_alphanumeric': 0.09143593045717965, 'fraction_numerical': 0.03734707018673535, 'mean_word_length': 1.5230102869518138, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4782066', 'n_tokens_mistral': 1588, 'n_tokens_neox': 1422, 'n_words': 342}