task:
  matrix:
    - name: Test (JDK 8)
      container:
        image: gradle:jdk8
    - name: Test (JDK 11)
      container:
        image: gradle:jdk11
  gradle_cache:
    folder: ~/.gradle/caches
  check_script: gradle check --stacktrace
  cleanup_before_cache_script:
    - rm -rf ~/.gradle/caches/$GRADLE_VERSION/
    - rm -f ~/.gradle/caches/user-id.txt
    - rm -f ~/.gradle/caches/journal-1/file-access.bin
    - find ~/.gradle/caches/ -name "*.lock" -type f -delete
  on_failure:
    junit_artifacts:
      path: "**/test-results/**/*.xml"
      format: junit

deploy_task:
  only_if: $CIRRUS_TAG != ''
  container:
    image: gradle:jdk8
  depends_on:
    - Test (JDK 8)
    - Test (JDK 11)
  environment:
    BINTRAY_API_KEY: ENCRYPTED[d86059880472037e15bb3ab28eb47726b84ff6d0dd5a0a8a40476dfc3aaa3e11ff34644a9df6c77c3036cca63d82ac54]
  deploy_script: gradle bintrayUpload --info

task:
  matrix:
    - name: Test (JDK 11)
      container:
        image: gradle:jdk11
  gradle_cache:
    folder: ~/.gradle/caches
  check_script: gradle check --stacktrace
  cleanup_before_cache_script:
    - rm -rf ~/.gradle/caches/$GRADLE_VERSION/
    - rm -f ~/.gradle/caches/user-id.txt
    - rm -f ~/.gradle/caches/journal-1/file-access.bin
    - find ~/.gradle/caches/ -name "*.lock" -type f -delete
  on_failure:
    junit_artifacts:
      path: "**/test-results/**/*.xml"
      format: junit

deploy_task:
  only_if: $CIRRUS_TAG != ''
  container:
    image: gradle:jdk8
  depends_on:
    - Test (JDK 11)
  environment:
    BINTRAY_API_KEY: ENCRYPTED[d86059880472037e15bb3ab28eb47726b84ff6d0dd5a0a8a40476dfc3aaa3e11ff34644a9df6c77c3036cca63d82ac54]
  deploy_script: gradle bintrayUpload --info

Test only on Java 11
Test only on Java 11
