env:
  global:
  # for CodeClimate
    - CC_TEST_REPORTER_ID=83a2e05f875e3a67f60a1969f20a558a3de03a7592052c8bf52807d0e317f01a
os:
- linux
- osx
language: java
jdk:
- openjdk8
- openjdk9
- openjdk10
- openjdk11
- openjdk12
- openjdk13
- openjdk14
- openjdk15
- openjdk16
- openjdk-ea

matrix:
  fast_finish: true
  exclude:
  - os: macos
    jdk: openjdk8
  - os: macos
    jdk: openjdk9
  - os: macos
    jdk: openjdk10
  allow_failures:
  - jdk: openjdk16
  - jdk: openjdk-ea
    #  - openjdk7 # Disabled to avoid error java.security.NoSuchProviderException: no such provider: SunEC...

install: skip
before_script:
  - chmod +x gradlew
# for CodeClimate
  - |
    if [ "$TRAVIS_OS_NAME" = "linux" ]; then
      curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter &&
        chmod +x ./cc-test-reporter &&
        ./cc-test-reporter before-build
    fi
script:
  - ./gradlew check --info --stacktrace
after_success:
  - bash <(curl -s https://codecov.io/bash)
  - |
    if [ "$TRAVIS_OS_NAME" = "linux" ]; then
      ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
    fi

cache:
  directories:
  - $HOME/.m2
