<commit_before>version: 2.1

commands:
  credentials:
    description: "Fetch temporary credentials if needed"
    steps:
      - run:
          name: Retrieve temporary Algolia credentials if needed
          command: |
            if [ -z "BINTRAY_USER" ]; then
              curl -s https://algoliasearch-client-keygen.herokuapp.com | sh >> $BASH_ENV
            fi
  test:
    description: "Run the test for Scala << parameters.scala_version >>"
    parameters:
      scala_version:
        type: string
    steps:
      - run:
          name: Run tests for Scala << parameters.scala_version >>
          command: |
            if [ -z "BINTRAY_USER" ]; then
              cat /dev/null | sbt -J-Dsun.net.maxDatagramSockets=2048 '++ << parameters.scala_version >> testOnly -- -l SkipInCI'
            else
              cat /dev/null | sbt -J-Dsun.net.maxDatagramSockets=2048 '++ << parameters.scala_version >> test'
            fi


jobs:
  format:
    docker:
      - image: circleci/openjdk:8-jdk
    steps:
      - checkout
      - restore_cache:
            key: sbt-cache-2-13
      - run:
          name: Check formatting
          command: cat /dev/null | sbt '++ 2.13.1 scalafmtCheckAll'
  test-2-11:
    docker:
      - image: circleci/openjdk:8-jdk
    steps:
      - checkout
      - restore_cache:
          key: sbt-cache-2-11
      - credentials
      - test:
          scala_version: "2.11.12"
      - save_cache:
          key: sbt-cache-2-11
          paths:
            - "~/.ivy2/cache"
            - "~/.sbt"
            - "~/.m2"
  test-2-12:
    docker:
      - image: circleci/openjdk:8-jdk
    steps:
      - checkout
      - restore_cache:
          key: sbt-cache-2-12
      - credentials
      - test:
          scala_version: "2.12.10"
      - save_cache:
          key: sbt-cache-2-12
          paths:
            - "~/.ivy2/cache"
            - "~/.sbt"
            - "~/.m2"
  test-2-13:
    docker:
      - image: circleci/openjdk:8-jdk
    steps:
      - checkout
      - restore_cache:
          key: sbt-cache-2-13
      - credentials
      - test:
          scala_version: "2.13.1"
      - save_cache:
          key: sbt-cache-2-13
          paths:
            - "~/.ivy2/cache"
            - "~/.sbt"
            - "~/.m2"

  release:
    docker:
      - image: circleci/openjdk:8-jdk
    steps:
      - checkout
      - run:
          name: Release new version
          command: |
            if [ -z "BINTRAY_USER" ]; then echo "BINTRAY_USER is not set";  exit 1; fi
            if [ -z "BINTRAY_PASS" ]; then echo "BINTRAY_PASS is not set";  exit 1; fi
            cat /dev/null | sbt '+publish'

workflows:
  version: 2
  build:
    jobs:
      - format
      - test-2-11
      - test-2-12
      - test-2-13
      - release:
          requires:
            - format
            - test-2-11
            - test-2-12
            - test-2-13
          filters:
            branches:
              only: master
            tags:
              only: /^[1-9]+.[0-9]+.[0-9]+.*/<commit_msg>chore(ci): run tests sequentially to reduce flakiness<commit_after>version: 2.1

commands:
  credentials:
    description: "Fetch temporary credentials if needed"
    steps:
      - run:
          name: Retrieve temporary Algolia credentials if needed
          command: |
            if [ -z "BINTRAY_USER" ]; then
              curl -s https://algoliasearch-client-keygen.herokuapp.com | sh >> $BASH_ENV
            fi
  test:
    description: "Run the test for Scala << parameters.scala_version >>"
    parameters:
      scala_version:
        type: string
    steps:
      - run:
          name: Run tests for Scala << parameters.scala_version >>
          command: |
            if [ -z "BINTRAY_USER" ]; then
              cat /dev/null | sbt -J-Dsun.net.maxDatagramSockets=2048 '++ << parameters.scala_version >> testOnly -- -l SkipInCI'
            else
              cat /dev/null | sbt -J-Dsun.net.maxDatagramSockets=2048 '++ << parameters.scala_version >> test'
            fi


jobs:
  format:
    docker:
      - image: circleci/openjdk:8-jdk
    steps:
      - checkout
      - restore_cache:
            key: sbt-cache-2-13
      - run:
          name: Check formatting
          command: cat /dev/null | sbt '++ 2.13.1 scalafmtCheckAll'
  test-2-11:
    docker:
      - image: circleci/openjdk:8-jdk
    steps:
      - checkout
      - restore_cache:
          key: sbt-cache-2-11
      - credentials
      - test:
          scala_version: "2.11.12"
      - save_cache:
          key: sbt-cache-2-11
          paths:
            - "~/.ivy2/cache"
            - "~/.sbt"
            - "~/.m2"
  test-2-12:
    docker:
      - image: circleci/openjdk:8-jdk
    steps:
      - checkout
      - restore_cache:
          key: sbt-cache-2-12
      - credentials
      - test:
          scala_version: "2.12.10"
      - save_cache:
          key: sbt-cache-2-12
          paths:
            - "~/.ivy2/cache"
            - "~/.sbt"
            - "~/.m2"
  test-2-13:
    docker:
      - image: circleci/openjdk:8-jdk
    steps:
      - checkout
      - restore_cache:
          key: sbt-cache-2-13
      - credentials
      - test:
          scala_version: "2.13.1"
      - save_cache:
          key: sbt-cache-2-13
          paths:
            - "~/.ivy2/cache"
            - "~/.sbt"
            - "~/.m2"

  release:
    docker:
      - image: circleci/openjdk:8-jdk
    steps:
      - checkout
      - run:
          name: Release new version
          command: |
            if [ -z "BINTRAY_USER" ]; then echo "BINTRAY_USER is not set";  exit 1; fi
            if [ -z "BINTRAY_PASS" ]; then echo "BINTRAY_PASS is not set";  exit 1; fi
            cat /dev/null | sbt '+publish'

workflows:
  version: 2
  build:
    jobs:
      - format
      - test-2-11
      - test-2-12:
          requires:
            - test-2-11
      - test-2-13:
          requires:
            - test-2-12
      - release:
          requires:
            - format
            - test-2-11
            - test-2-12
            - test-2-13
          filters:
            branches:
              only: master
            tags:
              only: /^[1-9]+.[0-9]+.[0-9]+.*/
{'fraction_non_alphanumeric': 0.12269641125121242, 'fraction_numerical': 0.03200775945683802, 'mean_word_length': 1.280501290084777, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, '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': '1028532', 'n_tokens_mistral': 2162, 'n_tokens_neox': 2034, 'n_words': 435}