<commit_before>version: 2

defaults: &defaults
  working_directory: ~/repo
  docker:
    - image: circleci/node:latest
  dependencies:
    pre:
      - echo "registry=https://registry.npmjs.org/" > ~/.npmrc
      - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
      - echo "registry=https://registry.npmjs.org/" > ~/repo/.npmrc
      - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/repo/.npmrc

jobs:
  setup:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          - v1-dependencies-
      - run: npm install
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      - persist_to_workspace:
          root: ~/repo
          paths: .
  test-merge:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/repo
      - run:
          name: "JavaScript Test Suite"
          environment:
            JEST_JUNIT_OUTPUT: reports/junit/js-test-results.xml
            COVERALLS_SERVICE_NAME: circleci
            COVERALLS_SERVICE_JOB_ID: $CIRCLE_BUILD_NUM
          command: npm run test:ci
      # Store our test results + Output
      - store_test_results:
          path: reports/junit
      - store_artifacts:
          path: reports/junit
      # Allows deploy to pickup where this job leaves off
      - persist_to_workspace:
          root: ~/repo
          paths: .
  test-pr:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/repo
      - run:
          name: "JavaScript Test Suite"
          environment:
            JEST_JUNIT_OUTPUT: reports/junit/js-test-results.xml
            COVERALLS_SERVICE_NAME: circleci
            COVERALLS_SERVICE_JOB_ID: $CIRCLE_BUILD_NUM
          command: npm run test:unit -- --coverage --coverageReporters=text-lcov
      # Store our test results + Output
      - store_test_results:
          path: reports/junit
      - store_artifacts:
          path: reports/junit
      # Allows deploy to pickup where this job leaves off
      - persist_to_workspace:
          root: ~/repo
          paths: .
  deploy:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/repo
      - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/repo/.npmrc'
      - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
      - run:
          name: Add auth token
          command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
      # - run:
      #     name: Who am i?
      #     command: npm whoami
      - run:
          name: Bump version number
          command: npm version 3.0.$CIRCLE_BUILD_NUM
      - run:
          name: Publish package
          command: npm publish --tag next

workflows:
  version: 2
  # Pull Requests
  build-test:<commit_msg>consistent env variable format<commit_after>version: 2

defaults: &defaults
  working_directory: ~/repo
  docker:
    - image: circleci/node:latest
  dependencies:
    pre:
      - echo "registry=https://registry.npmjs.org/" > ~/.npmrc
      - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
      - echo "registry=https://registry.npmjs.org/" > ~/repo/.npmrc
      - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/repo/.npmrc

jobs:
  setup:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          - v1-dependencies-
      - run: npm install
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      - persist_to_workspace:
          root: ~/repo
          paths: .
  test-merge:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/repo
      - run:
          name: "JavaScript Test Suite"
          environment:
            JEST_JUNIT_OUTPUT: reports/junit/js-test-results.xml
            COVERALLS_SERVICE_NAME: circleci
            COVERALLS_SERVICE_JOB_ID: ${CIRCLE_BUILD_NUM}
          command: npm run test:ci
      # Store our test results + Output
      - store_test_results:
          path: reports/junit
      - store_artifacts:
          path: reports/junit
      # Allows deploy to pickup where this job leaves off
      - persist_to_workspace:
          root: ~/repo
          paths: .
  test-pr:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/repo
      - run:
          name: "JavaScript Test Suite"
          environment:
            JEST_JUNIT_OUTPUT: reports/junit/js-test-results.xml
            COVERALLS_SERVICE_NAME: circleci
            COVERALLS_SERVICE_JOB_ID: ${CIRCLE_BUILD_NUM}
          command: npm run test:unit -- --coverage --coverageReporters=text-lcov
      # Store our test results + Output
      - store_test_results:
          path: reports/junit
      - store_artifacts:
          path: reports/junit
      # Allows deploy to pickup where this job leaves off
      - persist_to_workspace:
          root: ~/repo
          paths: .
  deploy:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/repo
      - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/repo/.npmrc'
      - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
      - run:
          name: Add auth token
          command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
      # - run:
      #     name: Who am i?
      #     command: npm whoami
      - run:
          name: Bump version number
          command: npm version 3.0.${CIRCLE_BUILD_NUM}
      - run:
          name: Publish package
          command: npm publish --tag next

workflows:
  version: 2
  # Pull Requests
  build-test:
{'fraction_non_alphanumeric': 0.1145420044850785, 'fraction_numerical': 0.002415042263239607, 'mean_word_length': 1.8118331716779825, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '767487', 'n_tokens_mistral': 1869, 'n_tokens_neox': 1801, 'n_words': 396}