language: scala

stages:
  - name: test
  - name: release
    if: (branch = master AND type = push) OR (tag IS present)

jobs:
  include:
    - env: TEST="scalafmt"
      jdk: oraclejdk8
      script: ./scalafmt --test
    - env: TEST="2.11"
      jdk: oraclejdk8
      script: sbt ci-test
    - env: TEST="2.12"
      jdk: oraclejdk8
      script: sbt ci-test
    - env: TEST="2.11"
      jdk: openjdk11
      script: sbt ci-test
    - env: TEST="2.12"
      jdk: openjdk11
      script: sbt ci-test
    - stage: release
      jdk: oraclejdk8
      script: sbt ci-release docs/docusaurusPublishGhpages

cache:
  directories:
    - $HOME/.sbt
    - $HOME/.ivy2/cache
    - $HOME/.coursier
    - target/repos

before_cache:
  - du -h -d 1 $HOME/.ivy2/cache
  - du -h -d 2 $HOME/.sbt/
  - find $HOME/.sbt -name "*.lock" -type f -delete
  - find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete
  - rm -rf $HOME/.ivy2/local

language: scala

stages:
  - name: test
  - name: release
    if: (branch = master AND type = push) OR (tag IS present)

jobs:
  include:
    - env: TEST="scalafmt"
      jdk: openjdk8
      script: ./scalafmt --test
    - env: TEST="2.11"
      jdk: openjdk8
      script: sbt ci-test
    - env: TEST="2.12"
      jdk: openjdk8
      script: sbt ci-test
    - env: TEST="2.11"
      jdk: openjdk11
      script: sbt ci-test
    - env: TEST="2.12"
      jdk: openjdk11
      script: sbt ci-test
    - stage: release
      jdk: openjdk8
      script: sbt ci-release docs/docusaurusPublishGhpages

cache:
  directories:
    - $HOME/.sbt
    - $HOME/.ivy2/cache
    - $HOME/.coursier
    - target/repos

before_cache:
  - du -h -d 1 $HOME/.ivy2/cache
  - du -h -d 2 $HOME/.sbt/
  - find $HOME/.sbt -name "*.lock" -type f -delete
  - find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete
  - rm -rf $HOME/.ivy2/local

Use openjdk8 instead of oraclejdk8
Use openjdk8 instead of oraclejdk8

> oraclejdk8 is not preinstalled on Xenial anymore, and cannot be
retrieved from Oracle itself anymore. We'd suggest using either openjdk,
or the currently supported Oracle JDK.

https://github.com/travis-ci/travis-ci/issues/10290
