From c3a588a649b2594d0bdbd00968651df27ca7bc0c Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Fri, 17 Jul 2015 16:16:20 +0200 Subject: [PATCH] Travis: migrating from legacy to container-based infrastructure --- .travis.yml | 53 +++++++++++++++++++- tools/travis/build.sh | 10 +++- tools/travis/install_dependencies.sh | 75 ++++++++++++++-------------- tools/travis/launch_tests.sh | 8 ++- 4 files changed, 103 insertions(+), 43 deletions(-) diff --git a/.travis.yml b/.travis.yml index b17c523de..b46d44ccf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ env: # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created # via the "travis encrypt" command using the project repo's public key - secure: "NvoMZI1lDLmdoKMgAJnNp3RzdRMYGfWL4buwPdIRyjJ522AIceVrT59x0//JB2bdbrABibo/o5TPP1dUGBJlVp9N250R0pjKz8zlehTL++6Y5z0zGWF9WRXOzrvTOCDpUAjJ24zwIREFy02qHmhcEbAy5+IE8aw9s3eZxsngL54=" + + - DEPENDENCIES_INSTALL=${TRAVIS_BUILD_DIR}/install-dependencies - TUTTLE_BUILD=${TRAVIS_BUILD_DIR}/build-tuttle - TUTTLE_INSTALL=${TRAVIS_BUILD_DIR}/install-tuttle - CI_NODE_TOTAL=2 @@ -17,6 +19,9 @@ compiler: - gcc - clang +# Use container-based infrastructure +sudo: false + matrix: exclude: - os: osx @@ -26,9 +31,12 @@ matrix: fast_finish: true cache: + # Caching Ubuntu packages apt: true + # Caching other directories directories: - - /usr/local/Cellar + - ${DEPENDENCIES_INSTALL} + - ${TRAVIS_BUILD_DIR}/TuttleOFX-data before_install: - env | sort @@ -58,6 +66,49 @@ after_failure: - cat ${TUTTLE_BUILD}/CMakeFiles/CMakeOutput.log addons: + apt: + sources: ['boost-latest', 'kalakris-cmake', 'kubuntu-backports'] + packages: + - cmake + - swig + - libboost1.55-all-dev + - python-dev + - python-numpy + - libfreetype6-dev + - libbz2-dev + - libltdl-dev + - libpng-dev + - libjpeg-dev + - libglew-dev + - libtiff4-dev + - libilmbase-dev + - libopenexr-dev + - libglew-dev + - libgraphviz-dev + - graphviz-dev + - python-nose + - python-imaging + - libturbojpeg + - libxmu-dev + - libmp3lame-dev + - liblzma-dev + - libxt-dev + - libmagickcore-dev + - liblcms2-dev + - libyaml-dev + + # Currently, these following packages are not available. + # Checkout this list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise + - libopenctl0.8 + - libcaca-dev + - libraw-dev + - libopenjpeg-dev + - libglui-dev + - libtinyxml-dev + - libopenimageio-dev + - yasm + - libx264-dev + - libxvidcore-dev coverity_scan: project: name: "tuttleofx/TuttleOFX" diff --git a/tools/travis/build.sh b/tools/travis/build.sh index 8f6d6b690..a366e03f9 100755 --- a/tools/travis/build.sh +++ b/tools/travis/build.sh @@ -9,10 +9,16 @@ set -x mkdir -p ${TUTTLE_BUILD} cd ${TUTTLE_BUILD} -# Ask cmake to search in all homebrew packages -CMAKE_PREFIX_PATH=$(echo /usr/local/Cellar/*/* | sed 's/ /;/g') +if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then + # Ask cmake to search in all dependencies we've installed manually + export CMAKE_PREFIX_PATH=$DEPENDENCIES_INSTALL +elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then + # Ask cmake to search in all homebrew packages + export CMAKE_PREFIX_PATH=$(echo /usr/local/Cellar/*/* | sed 's/ /;/g') +fi # Build tuttle +cmake --version cmake -DTUTTLE_EXPERIMENTAL=True -DCMAKE_INSTALL_PREFIX=${TUTTLE_INSTALL} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH .. make -j${CI_NODE_TOTAL} -k make install diff --git a/tools/travis/install_dependencies.sh b/tools/travis/install_dependencies.sh index 78a020b9e..21bf2a753 100755 --- a/tools/travis/install_dependencies.sh +++ b/tools/travis/install_dependencies.sh @@ -7,47 +7,47 @@ set -x if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then - sudo add-apt-repository -y ppa:boost-latest/ppa - sudo add-apt-repository -y ppa:irie/openimageio - sudo add-apt-repository -y ppa:kubuntu-ppa/backports - sudo apt-get update -qq + if [ ! -d "${DEPENDENCIES_INSTALL}/lib/" ]; then - sudo apt-get install -qq cmake swig swig2.0 libboost1.55-all-dev python-dev python-numpy libfreetype6-dev libXt-dev libbz2-dev liblcms-dev libopenctl0.8 libltdl-dev libpng-dev libcaca-dev libjpeg-dev libglew-dev libtiff-dev libilmbase-dev libopenexr-dev libMagickCore-dev libraw-dev libopenjpeg-dev libglui-dev libglew-dev graphviz graphviz-dev python-nose python-imaging libtinyxml-dev libyaml-cpp-dev libopenimageio-dev libturbojpeg libxmu-dev yasm libmp3lame-dev libx264-dev libxvidcore-dev liblzma-dev + cd $TRAVIS_BUILD_DIR + wget https://www.ffmpeg.org/releases/ffmpeg-2.2.9.tar.bz2 + bunzip2 ffmpeg-2.2.9.tar.bz2 + tar -xf ffmpeg-2.2.9.tar + cd ffmpeg-2.2.9 + ./configure --prefix=${DEPENDENCIES_INSTALL} --enable-shared --disable-static --disable-yasm && make -j${CI_NODE_TOTAL} && make install - cd $TRAVIS_BUILD_DIR - wget https://www.ffmpeg.org/releases/ffmpeg-2.2.9.tar.bz2 - bunzip2 ffmpeg-2.2.9.tar.bz2 - tar -xf ffmpeg-2.2.9.tar - cd ffmpeg-2.2.9 - ./configure --enable-shared --disable-static && make -j${CI_NODE_TOTAL} && sudo make install + cd $TRAVIS_BUILD_DIR + wget https://github.com/ampas/aces_container/archive/v1.0.tar.gz -O /tmp/aces_container-1.0.tar.gz + tar -xzf /tmp/aces_container-1.0.tar.gz + mkdir aces_container-1.0/build + cd aces_container-1.0/build + cmake .. -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make -j${CI_NODE_TOTAL} && make install - cd $TRAVIS_BUILD_DIR - wget https://github.com/ampas/aces_container/archive/v1.0.tar.gz -O /tmp/aces_container-1.0.tar.gz - tar -xzf /tmp/aces_container-1.0.tar.gz - mkdir aces_container-1.0/build - cd aces_container-1.0/build - cmake .. && make -j${CI_NODE_TOTAL} && sudo make install + cd $TRAVIS_BUILD_DIR + wget https://github.com/ampas/CTL/archive/ctl-1.5.2.tar.gz -O /tmp/ctl-1.5.2.tar.gz + tar -xzf /tmp/ctl-1.5.2.tar.gz + mkdir CTL-ctl-1.5.2/build + cd CTL-ctl-1.5.2/build + cmake .. -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make -j${CI_NODE_TOTAL} && make install - cd $TRAVIS_BUILD_DIR - wget https://github.com/ampas/CTL/archive/ctl-1.5.2.tar.gz -O /tmp/ctl-1.5.2.tar.gz - tar -xzf /tmp/ctl-1.5.2.tar.gz - mkdir CTL-ctl-1.5.2/build - cd CTL-ctl-1.5.2/build - cmake .. && make -j${CI_NODE_TOTAL} && sudo make install + cd $TRAVIS_BUILD_DIR + wget https://github.com/wdas/SeExpr/archive/rel-1.0.1.tar.gz -O /tmp/SeExpr-1.0.1.tar.gz + tar -xzf /tmp/SeExpr-1.0.1.tar.gz + mkdir SeExpr-rel-1.0.1/build + cd SeExpr-rel-1.0.1/build + cmake .. -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make -j${CI_NODE_TOTAL} && make install - cd $TRAVIS_BUILD_DIR - wget https://github.com/wdas/SeExpr/archive/rel-1.0.1.tar.gz -O /tmp/SeExpr-1.0.1.tar.gz - tar -xzf /tmp/SeExpr-1.0.1.tar.gz - mkdir SeExpr-rel-1.0.1/build - cd SeExpr-rel-1.0.1/build - cmake .. && make -j${CI_NODE_TOTAL} && sudo make install + cd $TRAVIS_BUILD_DIR + wget https://github.com/imageworks/OpenColorIO/archive/v1.0.9.tar.gz -O /tmp/ocio-1.0.9.tar.gz + tar -xzf /tmp/ocio-1.0.9.tar.gz + mkdir OpenColorIO-1.0.9/build + cd OpenColorIO-1.0.9/build + cmake .. -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make -j${CI_NODE_TOTAL} && make install + + else + echo 'Using cached directory.'; + fi - cd $TRAVIS_BUILD_DIR - wget https://github.com/imageworks/OpenColorIO/archive/v1.0.9.tar.gz -O /tmp/ocio-1.0.9.tar.gz - tar -xzf /tmp/ocio-1.0.9.tar.gz - mkdir OpenColorIO-1.0.9/build - cd OpenColorIO-1.0.9/build - cmake .. && make -j${CI_NODE_TOTAL} && sudo make install elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then @@ -57,10 +57,9 @@ elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then echo "Install TuttleOFX dependencies" brew install python - echo " - pip install nose for test" + echo "Pip install nose for test" pip install nose - echo " - install brew packages" + echo "Install brew packages" brew install swig ilmbase openexr jasper little-cms2 glew freetype fontconfig ffmpeg imagemagick libcaca aces_container ctl jpeg-turbo libraw seexpr openjpeg opencolorio openimageio numpy - echo "End dependencies installation." fi diff --git a/tools/travis/launch_tests.sh b/tools/travis/launch_tests.sh index 70700b092..64bd12460 100755 --- a/tools/travis/launch_tests.sh +++ b/tools/travis/launch_tests.sh @@ -2,11 +2,15 @@ # set env export OFX_PLUGIN_PATH=${TUTTLE_INSTALL}/OFX -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${TUTTLE_INSTALL}/lib +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${DEPENDENCIES_INSTALL}/lib:${TUTTLE_INSTALL}/lib export PYTHONPATH=${TUTTLE_INSTALL}/lib/python2.7/site-packages:$PYTHONPATH # clone data for tests -git clone https://github.com/tuttleofx/TuttleOFX-data.git +if [ ! -d "${TRAVIS_BUILD_DIR}/TuttleOFX-data" ]; then + git clone https://github.com/tuttleofx/TuttleOFX-data.git +else + echo 'Using cached directory.'; +fi # nosetests ln -s ${TRAVIS_BUILD_DIR}/TuttleOFX-data ${TRAVIS_BUILD_DIR}/libraries/tuttle/pyTest/TuttleOFX-data