<commit_before>version: 2.1

# -------------------------
#        DEFAULTS
# -------------------------
defaults: &defaults
  working_directory: ~/react-native
  environment:
    - GIT_COMMIT_DESC: git log --format=oneline -n 1 $CIRCLE_SHA1

# -------------------------
#        EXECUTORS
# -------------------------
executors:
  node8:
    <<: *defaults
    docker:
      - image: circleci/node:8
  nodelts:
    <<: *defaults
    docker:
      - image: circleci/node:lts
  reactnativeandroid:
    <<: *defaults
    docker:
      - image: reactnativecommunity/react-native-android:2019-9-4
    resource_class: "large"
    environment:
      - TERM: "dumb"
      - ADB_INSTALL_TIMEOUT: 10
      - _JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
      - GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError"'
      - BUILD_THREADS: 2
  reactnativeios:
    <<: *defaults
    macos:
      xcode: "10.2.1"

# -------------------------
#        COMMANDS
# -------------------------
commands:
  restore_cache_checkout:
    parameters:
      checkout_type:
        type: string
        default: node
    steps:
      - restore_cache:
          key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}-<< parameters.checkout_type >>

  setup_artifacts:
    steps:
      - run:
          name: Initial Setup
          command: mkdir -p ~/reports/{buck,build,junit,outputs}

  run_yarn:
    steps:
      - restore_cache:
          keys:
            - v3-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
            - v3-yarn-cache-{{ arch }}
      - run:
          name: Run Yarn
          command: |
            # Skip yarn install on metro bump commits as the package is not yet
            # available on npm
            if [[ $(echo "$GIT_COMMIT_DESC" | grep -c "Bump metro@") -eq 0 ]]; then
              yarn install --non-interactive --cache-folder ~/.cache/yarn
            fi
      - save_cache:
          paths:
            - ~/.cache/yarn
          key: v3-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}

  install_buck_tooling:<commit_msg>Bump Yarn cache key and fix JavaScript tests (#27343)<commit_after>version: 2.1

# -------------------------
#        DEFAULTS
# -------------------------
defaults: &defaults
  working_directory: ~/react-native
  environment:
    - GIT_COMMIT_DESC: git log --format=oneline -n 1 $CIRCLE_SHA1

# -------------------------
#        EXECUTORS
# -------------------------
executors:
  node8:
    <<: *defaults
    docker:
      - image: circleci/node:8
  nodelts:
    <<: *defaults
    docker:
      - image: circleci/node:lts
  reactnativeandroid:
    <<: *defaults
    docker:
      - image: reactnativecommunity/react-native-android:2019-9-4
    resource_class: "large"
    environment:
      - TERM: "dumb"
      - ADB_INSTALL_TIMEOUT: 10
      - _JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
      - GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError"'
      - BUILD_THREADS: 2
  reactnativeios:
    <<: *defaults
    macos:
      xcode: "10.2.1"

# -------------------------
#        COMMANDS
# -------------------------
commands:
  restore_cache_checkout:
    parameters:
      checkout_type:
        type: string
        default: node
    steps:
      - restore_cache:
          key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}-<< parameters.checkout_type >>

  setup_artifacts:
    steps:
      - run:
          name: Initial Setup
          command: mkdir -p ~/reports/{buck,build,junit,outputs}

  run_yarn:
    steps:
      - restore_cache:
          keys:
            - v4-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
            - v4-yarn-cache-{{ arch }}
      - run:
          name: Run Yarn
          command: |
            # Skip yarn install on metro bump commits as the package is not yet
            # available on npm
            if [[ $(echo "$GIT_COMMIT_DESC" | grep -c "Bump metro@") -eq 0 ]]; then
              yarn install --non-interactive --cache-folder ~/.cache/yarn
            fi
      - save_cache:
          paths:
            - ~/.cache/yarn
          key: v4-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}

  install_buck_tooling:
{'fraction_non_alphanumeric': 0.1843220338983051, 'fraction_numerical': 0.012947269303201506, 'mean_word_length': 1.644057249533292, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 7, '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': '5245190', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1346, 'n_words': 273}