diff --git a/.travis.yml b/.travis.yml index e66d9b92264..69501577780 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,41 +1,20 @@ language: java -sudo: required dist: trusty group: edge -# from https://docs.travis-ci.com/user/customizing-the-build -# A build on Travis CI is made up of two steps: install: (install any dependencies required), script: (run the build script) +env: + - SCRIPT=travis-jdk9.sh + - SCRIPT=travis-jdk8.sh + - SCRIPT=travis-coverage.sh + - SCRIPT=travis-verify.sh -install: - - # download deps with maven - - mvn dependency:resolve - - pip install --user CommonMark requests pygithub - - sudo apt-get install xmlstarlet +script: ./chore/travis/$SCRIPT -matrix: - include: - - env: JDK_VERSION=1.9 - jdk: oraclejdk9 - - env: JDK_VERSION=1.8 - jdk: oraclejdk9 - - env: JDK_VERSION=1.8 - jdk: oraclejdk8 - -script: | - # compiles and install - mvn -Djava.src.version=$JDK_VERSION install -DskipTests && - - # checkstyle, license, javadoc, animal sniffer. - mvn -Djava.src.version=$JDK_VERSION verify site -DskipTests && - - # the unit tests - mvn -Djava.src.version=$JDK_VERSION test jacoco:report && - - # uploading coverage, but not failing - mvn -Djava.src.version=$JDK_VERSION coveralls:report -Pcoveralls --fail-never && - - # documentation - python chore/check-links-in-doc.py +cache: + directories: + - $HOME/.m2 +before_cache: + - rm -rf $HOME/.m2/fr/inria/ # delete all to be sure we always get last snapshot of spoon \ No newline at end of file diff --git a/chore/travis/travis-coverage.sh b/chore/travis/travis-coverage.sh new file mode 100755 index 00000000000..a9f3cfbbf01 --- /dev/null +++ b/chore/travis/travis-coverage.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# This script intends to be run on TravisCI +# It only computes and publish (through coveralls) the coverage of Spoon + + +source /opt/jdk_switcher/jdk_switcher.sh + +jdk_switcher use oraclejdk8 && mvn -Djava.src.version=1.8 test jacoco:report && mvn -Djava.src.version=1.8 coveralls:report -Pcoveralls --fail-never \ No newline at end of file diff --git a/chore/travis/travis-jdk8.sh b/chore/travis/travis-jdk8.sh new file mode 100755 index 00000000000..d97b940a7ee --- /dev/null +++ b/chore/travis/travis-jdk8.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# This script intends to be run on TravisCI +# It executes compile and test goals + +source /opt/jdk_switcher/jdk_switcher.sh + +jdk_switcher use oraclejdk8 & mvn -Djava.src.version=1.8 test \ No newline at end of file diff --git a/chore/travis/travis-jdk9.sh b/chore/travis/travis-jdk9.sh new file mode 100755 index 00000000000..63d91a5b83b --- /dev/null +++ b/chore/travis/travis-jdk9.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# This script intends to be run on TravisCI +# It executes compile and test goals + +source /opt/jdk_switcher/jdk_switcher.sh + +jdk_switcher use oraclejdk9 && mvn -Djava.src.version=1.9 test \ No newline at end of file diff --git a/chore/travis/travis-verify.sh b/chore/travis/travis-verify.sh new file mode 100755 index 00000000000..1ed43defdb5 --- /dev/null +++ b/chore/travis/travis-verify.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# This script intends to be run on TravisCI +# it runs verify and site maven goals +# and to check documentation links + +source /opt/jdk_switcher/jdk_switcher.sh +pip install --user CommonMark requests pygithub + +jdk_switcher use oraclejdk9 && mvn -Djava.src.version=1.9 verify site install -DskipTests && python ./chore/check-links-in-doc.py \ No newline at end of file