<commit_before>version: 2
jobs:
  build:
    docker:
      - image: menny/android_ndk:1.6.1a

    working_directory: //opt/workspace/

    environment:
      CODECOV_TOKEN: <PASSWORD>
      COV_REPORT_LOCATION: app/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml
      TERM: dumb
      _JAVA_OPTIONS: "-Xmx1400m -XX:ParallelGCThreads=2 -XX:ConcGCThreads=2 -XX:ParallelGCThreads=2 -Djava.util.concurrent.ForkJoinPool.common.parallelism=2"

    steps:
      - checkout

      - restore_cache:
          key: anysoftkeyboard-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "circle.yml" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}

      - run:
          name: Setup environment
          command: scripts/ci_setup.sh

      - run:
          name: Build
          command: scripts/ci_assemble.sh

      - run:
          name: Run Checks
          command: scripts/ci_check.sh

      - store_artifacts:
          path: app/build/reports/
          destination: lint_reports/app

      - store_artifacts:
          path: base/build/reports/
          destination: lint_reports/base

      - store_artifacts:
          path: jnidictionaryv1/build/reports/
          destination: lint_reports/jnidictionaryv1

      - store_artifacts:
          path: jnidictionaryv2/build/reports/
          destination: lint_reports/jnidictionaryv2

      - store_artifacts:
          path: nextword/build/reports/
          destination: lint_reports/nextword

      - run:
          name: Run Tests
          command: scripts/ci_test.sh

      - store_artifacts:
          path: app/build/reports/tests/
          destination: tests_reports/

      - run:
          name: Upload coverage to CodeCov
          command: if [[ -f $COV_REPORT_LOCATION ]]; then ./scripts/ci_binaries/codecov.sh -X gcov -X coveragepy -f $COV_REPORT_LOCATION; fi

      - store_test_results:
          path: "app/build/test-results/testDebugUnitTest/"

      - deploy:
          name: Deploy to Play Store
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ] && [ "${CIRCLE_PROJECT_USERNAME}" == "AnySoftKeyboard" ]; then<commit_msg>CI Cache fix<commit_after>version: 2
jobs:
  build:
    docker:
      - image: menny/android_ndk:1.6.1a

    working_directory: /opt/workspace/

    environment:
      CODECOV_TOKEN: 1<PASSWORD>
      COV_REPORT_LOCATION: app/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml
      TERM: dumb
      _JAVA_OPTIONS: "-Xmx1400m -XX:ParallelGCThreads=2 -XX:ConcGCThreads=2 -XX:ParallelGCThreads=2 -Djava.util.concurrent.ForkJoinPool.common.parallelism=2"

    steps:
      - checkout

      - restore_cache:
          key: anysoftkeyboard-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "circle.yml" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}

      - run:
          name: Setup environment
          command: scripts/ci_setup.sh

      - run:
          name: Run Checks
          command: |
            if [ "${CIRCLE_NODE_INDEX}" == "0" ]; then
              ./scripts/ci_check.sh
              BUILD_EXIT_CODE=$?

              mkdir lint_reports || true

              cp -r app/build/reports/ lint_reports/
              cp -r base/build/reports/ lint_reports/
              cp -r jnidictionaryv1/build/reports/ lint_reports/
              cp -r jnidictionaryv2/build/reports/ lint_reports/
              cp -r nextword/build/reports/ lint_reports/

              exit ${BUILD_EXIT_CODE}
            fi

      - store_artifacts:
          path: lint_reports/
          destination: lint_reports/

      - run:
          name: Run Tests
          command: |
            if [ "${CIRCLE_NODE_INDEX}" == "1" ]; then
              ./scripts/ci_test.sh
              if [[ -f $COV_REPORT_LOCATION ]]; then
                ./scripts/ci_binaries/codecov.sh -X gcov -X coveragepy -f ${COV_REPORT_LOCATION}
              fi
            fi

      - store_artifacts:
          path: app/build/reports/tests/
          destination: tests_reports/

      - store_test_results:
          path: "app/build/test-results/testDebugUnitTest/"

      - deploy:
          name: Deploy to Play Store
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ] && [ "${CIRCLE_PROJECT_USERNAME}" == "AnySoftKeyboard" ]; then
{'fraction_non_alphanumeric': 0.10747021081576535, 'fraction_numerical': 0.007561869844179652, 'mean_word_length': 2.0333564975677554, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6379511', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1364, 'n_words': 251}