diff --git a/.travis.yml b/.travis.yml index 032ffe7159..32eea85706 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,13 +62,10 @@ matrix: os: linux install: - - cmake --version + - source ci/install_travis.sh script: - - mkdir build - - cd build - - cmake -DCMAKE_INSTALL_PREFIX=$HOME/ext .. - - cmake --build . --target install + - ci/test_travis.sh notifications: email: false diff --git a/ci/install_travis.sh b/ci/install_travis.sh new file mode 100644 index 0000000000..481d674367 --- /dev/null +++ b/ci/install_travis.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# Exit on error +set -e +# Echo each command +set -x + +export SOURCE_DIR=`pwd` +export our_install_dir="$HOME/our_usr" + +if [[ ! -d $HOME/conda_root/pkgs ]]; then + rm -rf $HOME/conda_root + if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then + wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh + else + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh + fi + bash miniconda.sh -b -p $HOME/conda_root +fi +export PATH="$HOME/conda_root/bin:$PATH" +conda config --set always_yes yes --set changeps1 no +conda config --add channels conda-forge --force +# Useful for debugging any issues with conda +conda info -a + +conda_pkgs="qt cmake" + +conda create -q -p $our_install_dir ${conda_pkgs} +source activate $our_install_dir + +cd $SOURCE_DIR; + +# Since this script is getting sourced, remove error on exit +set +e +set +x diff --git a/ci/test_travis.sh b/ci/test_travis.sh new file mode 100755 index 0000000000..d9c8250270 --- /dev/null +++ b/ci/test_travis.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Exit on error +set -e +# Echo each command +set -x + +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX .. +cmake --build . --target install