diff --git a/.travis.yml b/.travis.yml index c187c7d34..44966cb4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,16 @@ language: java git: depth: false -jdk: - - openjdk8 - - openjdk11 +jobs: + include: + - jdk: openjdk8 + env: JAVA_VERSION_PROFILE=jdk8 + - jdk: openjdk11 + env: JAVA_VERSION_PROFILE=jdk11 + - jdk: openjdk16 + env: JAVA_VERSION_PROFILE=jdk11 + allow_failures: + - jdk: openjdk16 addons: apt: @@ -16,20 +23,22 @@ addons: sonarcloud: organization: datadriven -install: true - before_script: - wget https://github.com/sormuras/bach/raw/master/install-jdk.sh + script: - - mvn spotless:check -B -V && mvn install -B -V -Pallow-snapshots,with-coverage,travis -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.shade=error || (sleep 5; exit 1) + - echo "Running with profile: ${JAVA_VERSION_PROFILE}" + - mvn spotless:check -B -V && mvn install -B -V -Pallow-snapshots,with-coverage,travis,${JAVA_VERSION_PROFILE} -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.shade=error || (sleep 5; exit 1) + +after_script: - export JAVA_HOME=$HOME/openjdk11 - chmod u+x $TRAVIS_BUILD_DIR/install-jdk.sh - $TRAVIS_BUILD_DIR/install-jdk.sh --feature 11 --target $JAVA_HOME - - if [ "${TRAVIS_PULL_REQUEST}" != "false" ] || [ "${TRAVIS_BRANCH}" == "master" ]; then mvn sonar:sonar -B -V -Pallow-snapshots,with-coverage,travis; fi + - if [ "${TRAVIS_PULL_REQUEST}" != "false" ] || [ "${TRAVIS_BRANCH}" == "master" ]; then mvn sonar:sonar -B -V -Pallow-snapshots,with-coverage,travis,${JAVA_VERSION_PROFILE}; fi before_cache: rm -rf ~/.m2/repository/cz/o2/proxima || /bin/true cache: directories: - - '$HOME/.m2/repository' - - '$HOME/.sonar/cache' + - $HOME/.m2/repository + - $HOME/.sonar/cache