<commit_before>checkout_submodule: &checkout_submodule
  run:
    name: Checkout submodule
    command: |
        git submodule sync
        git submodule update --init --recursive

node_modules_cache_key: &node_modules_cache_key
  yarn-deps-v1-{{ checksum "yarn.lock" }}

restore_node_modules_cache: &restore_node_modules_cache
  restore_cache:
    keys:
      - *node_modules_cache_key
      - yarn-deps-v1-

yarn_install: &yarn_install
  run:
    name: Install dependencies
    command: yarn

screenshotter: &screenshotter
  steps:
    - checkout
    - *checkout_submodule

    - *restore_node_modules_cache
    - *yarn_install

    - run:
        name: Verify screenshots and generate diffs and new screenshots
        command: node dockers/Screenshotter/screenshotter.js --selenium-ip localhost -b $CIRCLE_JOB --verify --diff --new

    - store_artifacts:
        path: test/screenshotter/new
        destination: new
    - store_artifacts:
        path: test/screenshotter/diff
        destination: diff

version: 2
jobs:
  test:
    docker:
      - image: circleci/node:6
    steps:
      - run:
          name: Check whether the build is running on the main repository
          command: |
              if [[ $CIRCLE_PULL_REQUEST && $CIRCLE_PROJECT_USERNAME != "Khan" ]]; then
                echo "Please disable CircleCI on your forked repository!"
                exit 1
              fi

      - checkout
      - *checkout_submodule

      - *restore_node_modules_cache
      - *yarn_install
      - save_cache:
          key: *node_modules_cache_key
          paths:
            - node_modules

      - run:
          name: Run tests
          command: yarn test --coverage
      - run:
          name: Upload code coverage reports to Codecov
          command: ./node_modules/.bin/codecov

      - run:
          name: Build KaTeX
          command: yarn build

      - store_artifacts:
          path: dist/katex.js
          destination: katex.js
      - store_artifacts:
          path: dist/katex.css
          destination: katex.css
      - store_artifacts:
          path: dist/fonts
          destination: fonts

  firefox:
    docker:
      - image: circleci/node:6
      - image: selenium/standalone-firefox:2.48.2
    <<: *screenshotter
  chrome:
    docker:
      - image: circleci/node:6
      - image: selenium/standalone-chrome:2.48.2
    <<: *screenshotter

workflows:
  version: 2
  screenshotter:
    jobs:
      - test
      - firefox
      - chrome<commit_msg>Upload minified files to CircleCI build artifacts (#1581)<commit_after>checkout_submodule: &checkout_submodule
  run:
    name: Checkout submodule
    command: |
        git submodule sync
        git submodule update --init --recursive

node_modules_cache_key: &node_modules_cache_key
  yarn-deps-v1-{{ checksum "yarn.lock" }}

restore_node_modules_cache: &restore_node_modules_cache
  restore_cache:
    keys:
      - *node_modules_cache_key
      - yarn-deps-v1-

yarn_install: &yarn_install
  run:
    name: Install dependencies
    command: yarn

screenshotter: &screenshotter
  steps:
    - checkout
    - *checkout_submodule

    - *restore_node_modules_cache
    - *yarn_install

    - run:
        name: Verify screenshots and generate diffs and new screenshots
        command: node dockers/Screenshotter/screenshotter.js --selenium-ip localhost -b $CIRCLE_JOB --verify --diff --new

    - store_artifacts:
        path: test/screenshotter/new
        destination: new
    - store_artifacts:
        path: test/screenshotter/diff
        destination: diff

version: 2
jobs:
  test:
    docker:
      - image: circleci/node:6
    steps:
      - run:
          name: Check whether the build is running on the main repository
          command: |
              if [[ $CIRCLE_PULL_REQUEST && $CIRCLE_PROJECT_USERNAME != "Khan" ]]; then
                echo "Please disable CircleCI on your forked repository!"
                exit 1
              fi

      - checkout
      - *checkout_submodule

      - *restore_node_modules_cache
      - *yarn_install
      - save_cache:
          key: *node_modules_cache_key
          paths:
            - node_modules

      - run:
          name: Run tests
          command: yarn test --coverage
      - run:
          name: Upload code coverage reports to Codecov
          command: ./node_modules/.bin/codecov

      - run:
          name: Build KaTeX
          command: yarn build

      - store_artifacts:
          path: dist/katex.min.js
          destination: katex.min.js
      - store_artifacts:
          path: dist/katex.min.css
          destination: katex.min.css
      - store_artifacts:
          path: dist/fonts
          destination: fonts

  firefox:
    docker:
      - image: circleci/node:6
      - image: selenium/standalone-firefox:2.48.2
    <<: *screenshotter
  chrome:
    docker:
      - image: circleci/node:6
      - image: selenium/standalone-chrome:2.48.2
    <<: *screenshotter

workflows:
  version: 2
  screenshotter:
    jobs:
      - test
      - firefox
      - chrome
{'fraction_non_alphanumeric': 0.08141838351822504, 'fraction_numerical': 0.0071315372424722665, 'mean_word_length': 1.9875739644970414, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '767498', 'n_tokens_mistral': 1641, 'n_tokens_neox': 1555, 'n_words': 364}