From 3aaa6860418f17174fb10004473a465c0a649cb0 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Sun, 26 Jul 2015 20:59:05 +0200 Subject: [PATCH] Updated travis config. --- .travis.yml | 18 +++++++++++++++--- contrib/utilities/check_indentation.sh | 2 -- contrib/utilities/setup_astyle.sh | 26 +++++++++++++++++++------- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index aa013ce482..d711326c09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,23 @@ +sudo : false + +notifications: + email: false + language: C++ compiler: -- gcc + - gcc + +cache: + directories: + - programs -before_install: ./contrib/utilities/setup_astyle.sh +install: + - export PATH=$PWD/programs/astyle/build/gcc/bin:$PATH + - ./contrib/utilities/setup_astyle.sh -script: ./contrib/utilities/check_indentation.sh +script: + - ./contrib/utilities/check_indentation.sh branches: only: diff --git a/contrib/utilities/check_indentation.sh b/contrib/utilities/check_indentation.sh index abca027318..7a859c98e3 100755 --- a/contrib/utilities/check_indentation.sh +++ b/contrib/utilities/check_indentation.sh @@ -6,8 +6,6 @@ else echo "Running indentation test on Pull Request #${TRAVIS_PULL_REQUEST}" fi -export PATH=`pwd`/astyle/build/gcc/bin:$PATH - ./contrib/utilities/indent git diff git diff-files --quiet diff --git a/contrib/utilities/setup_astyle.sh b/contrib/utilities/setup_astyle.sh index cb1488595e..4f0f53dc70 100755 --- a/contrib/utilities/setup_astyle.sh +++ b/contrib/utilities/setup_astyle.sh @@ -1,8 +1,20 @@ #!/bin/sh -echo "Downloading and installing astyle." -wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.04/astyle_2.04_linux.tar.gz > /dev/null -tar xvfz astyle_2.04_linux.tar.gz > /dev/null -cd astyle/build/gcc -make -j4 > /dev/null -cd ../../../ -export PATH=`pwd`/astyle/build/gcc/bin:$PATH + +PRG=$PWD/programs + +if [ ! -d $PRG ] +then + echo "create folder `$PRG`" + mkdir $PRG +fi + +# astyle +if [ ! -d $PRG/astyle ] +then + echo "Downloading and installing astyle." + mkdir $PRG/astyle + wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.04/astyle_2.04_linux.tar.gz > /dev/null + tar xfz astyle_2.04_linux.tar.gz -C $PRG > /dev/null + cd $PRG/astyle/build/gcc + make -j4 > /dev/null +fi -- 2.39.5