<commit_before>version: ~> 1.0

language: scala

# Only build non-pushes (so PRs, API requests & cron jobs) OR tags OR forks OR main branch builds
# https://docs.travis-ci.com/user/conditional-builds-stages-jobs/
if: type != push OR tag IS present OR repo != lagom/lagom OR branch IN (master, 1.6.x, 1.5.x, 1.4.x)

addons:
  apt:
    packages:
      # Needed for `xmllint` which is used to validate pom files
      - libxml2-utils
      - xmlstarlet
      # Used to download maven xsd file
      - wget

env:
  global:
    # the following `secure` is WHITESOURCE_PASSWORD which is the same for all branches.
    - secure: "<KEY>
  matrix:
    - TRAVIS_JDK=8

before_install:
  # See https://github.com/travis-ci/travis-ci/issues/4629#issuecomment-239493916
  - rm ~/.m2/settings.xml
  - curl -Ls https://git.io/jabba | bash && . ~/.jabba/jabba.sh
install: jabba install $(jabba ls-remote "adopt@~1.$TRAVIS_JDK.0-0" --latest=patch) && jabba use "$_" && java -Xmx32m -version

git:
  depth: false # Avoid sbt-dynver not seeing the tag

stages:
  - drop-travis-caches
  - validations-and-test
  - test-build-tools

jobs:
  include:
    - stage: drop-travis-caches
      # Introduced 2020-10-19 as we noticed serious problems with Travis' caching
      script:
        - rm -rf $HOME/.cache/coursier
        - rm -rf $HOME/.ivy2/cache
        - rm -rf $HOME/.jabba
        - rm -rf $HOME/.sbt
        - rm -rf $HOME/.m2/repositories
      name: "drop-travis-caches"
    - stage: validations-and-test
      script: bin/test-code-style
      name: "Code validations (format, binary compatibilty, whitesource, etc.)"
    - script: SCALA_VERSION=2.12.10 bin/test-2.1x
      name: "Run tests for Scala 2.12"
    - script: SCALA_VERSION=2.12.10 bin/test-2.1x
      env: TRAVIS_JDK=11
      name: "Run tests for Scala 2.12 and Java 11"
    - script: SCALA_VERSION=2.13.0 bin/test-2.1x
      name: "Run tests for Scala 2.13"<commit_msg>Empty Travis' caches on explicit demand<commit_after>version: ~> 1.0

language: scala

# Only build non-pushes (so PRs, API requests & cron jobs) OR tags OR forks OR main branch builds
# https://docs.travis-ci.com/user/conditional-builds-stages-jobs/
if: type != push OR tag IS present OR repo != lagom/lagom OR branch IN (master, 1.6.x, 1.5.x, 1.4.x)

addons:
  apt:
    packages:
      # Needed for `xmllint` which is used to validate pom files
      - libxml2-utils
      - xmlstarlet
      # Used to download maven xsd file
      - wget

env:
  global:
    - RUN_DROP_TRAVIS_CACHES_STAGE=false
    # the following `secure` is WHITESOURCE_PASSWORD which is the same for all branches.
    - secure: "<KEY>
  matrix:
    - TRAVIS_JDK=8

before_install:
  # See https://github.com/travis-ci/travis-ci/issues/4629#issuecomment-239493916
  - rm ~/.m2/settings.xml
  - curl -Ls https://git.io/jabba | bash && . ~/.jabba/jabba.sh
install: jabba install $(jabba ls-remote "adopt@~1.$TRAVIS_JDK.0-0" --latest=patch) && jabba use "$_" && java -Xmx32m -version

git:
  depth: false # Avoid sbt-dynver not seeing the tag

stages:
  - name: drop-travis-caches
    # to drop caches trigger a custom build with
    # env:
    #   global:
    #     - RUN_DROP_TRAVIS_CACHES_STAGE=true
    if: env(RUN_DROP_TRAVIS_CACHES_STAGE) = true
  - name: validations-and-test
  - name: test-build-tools

jobs:
  include:
    - stage: drop-travis-caches
      # Introduced 2020-10-19 as we noticed serious problems with Travis' caching
      script:
        - rm -rf $HOME/.cache/coursier
        - rm -rf $HOME/.ivy2/cache
        - rm -rf $HOME/.jabba
        - rm -rf $HOME/.sbt
        - rm -rf $HOME/.m2/repositories
      name: "drop-travis-caches"
    - stage: validations-and-test
      script: bin/test-code-style
      name: "Code validations (format, binary compatibilty, whitesource, etc.)"
    - script: SCALA_VERSION=2.12.10 bin/test-2.1x
      name: "Run tests for Scala 2.12"
    - script: SCALA_VERSION=2.12.10 bin/test-2.1x
      env: TRAVIS_JDK=11
      name: "Run tests for Scala 2.12 and Java 11"
    - script: SCALA_VERSION=2.13.0 bin/test-2.1x
      name: "Run tests for Scala 2.13"
{'fraction_non_alphanumeric': 0.12280701754385964, 'fraction_numerical': 0.03508771929824561, 'mean_word_length': 2.554112554112554, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6662206', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1530, 'n_words': 402}