Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

review chore: improve Travis configuration and speed-up builds #1655

Merged
merged 15 commits into from
Oct 31, 2017
43 changes: 11 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions chore/travis/travis-coverage.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions chore/travis/travis-jdk8.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions chore/travis/travis-jdk9.sh
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions chore/travis/travis-verify.sh
Original file line number Diff line number Diff line change
@@ -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