From fd2a8f5c70c3b3e1287502e3c4b5bbd63bdc976f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Mon, 18 Nov 2019 11:43:37 -0700 Subject: [PATCH 1/7] Improve Travis: test on Linux and macOS Keep the Doxygen run as before, but also test building and installing using cmake on Linux and macOS with both gcc and clang. --- .travis.yml | 91 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 35 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3fc74e6c7c..f9620d7f77 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,45 +1,65 @@ +language: cpp sudo: false +compiler: + - gcc + - clang +os: + - linux + - osx dist: xenial +osx_image: xcode7.3 -branches: - only: - - master +matrix: + exclude: + - compiler: clang + - os: osx + include: + - env: BUILD_DOXYGEN="yes" + compiler: gcc + os: linux + addons: + apt: + packages: + - doxygen + - doxygen-doc + - doxygen-latex + - doxygen-gui + - graphviz + install: + - pwd + - doxygen --version + ############################################################################ + # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/ + ############################################################################ + - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" + - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} + ############################################################################ + # Install a recent Doxygen + ############################################################################ + - DOXYGEN_URL="http://doxygen.nl/files/doxygen-1.8.16.linux.bin.tar.gz" + - mkdir doxygen + - travis_retry wget -O - ${DOXYGEN_URL} | tar --strip-components=1 -xz -C doxygen + - export PATH=${DEPS_DIR}/doxygen/bin:${PATH} + - doxygen --version + script: + - pwd + - cd ${TRAVIS_BUILD_DIR} + - cd doc + - doxygen --version + - doxygen Doxyfile + - echo "" > html/.nojekyll -# Install dependencies -addons: - apt: - packages: - - doxygen - - doxygen-doc - - doxygen-latex - - doxygen-gui - - graphviz - - install: - - pwd - - doxygen --version - ############################################################################ - # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/ - ############################################################################ - - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} - ############################################################################ - # Install a recent Doxygen - ############################################################################ - - DOXYGEN_URL="http://doxygen.nl/files/doxygen-1.8.16.linux.bin.tar.gz" - - mkdir doxygen - - travis_retry wget -O - ${DOXYGEN_URL} | tar --strip-components=1 -xz -C doxygen - - export PATH=${DEPS_DIR}/doxygen/bin:${PATH} - - doxygen --version + - cmake --version script: - - pwd - - cd ${TRAVIS_BUILD_DIR} - - cd doc - - doxygen --version - - doxygen Doxyfile - - echo "" > html/.nojekyll + - mkdir build + - cd build + - cmake -DCMAKE_INSTALL_PREFIX=$HOME/ext .. + - cmake --build . --target install + +notifications: + email: false deploy: provider: pages @@ -50,3 +70,4 @@ deploy: github_token: $GH_REPO_TOKEN on: branch: master + condition: $BUILD_DOXYGEN = yes From 700ec93abc3bf027b036c6cc0ea6ba666c6126b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Mon, 18 Nov 2019 11:48:50 -0700 Subject: [PATCH 2/7] Fix the test matrix --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index f9620d7f77..032ffe7159 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,13 @@ osx_image: xcode7.3 matrix: exclude: + # Disable all automatic entries in the test matrix - compiler: clang + - compiler: gcc - os: osx + - os: linux include: + # Explicitly add tests that we want to run - env: BUILD_DOXYGEN="yes" compiler: gcc os: linux @@ -48,6 +52,14 @@ matrix: - doxygen --version - doxygen Doxyfile - echo "" > html/.nojekyll + - compiler: clang + os: osx + - compiler: gcc + os: osx + - compiler: clang + os: linux + - compiler: gcc + os: linux install: - cmake --version From 2c6d6f43016b5d32a202f25ca0d25b2c3b31aee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Mon, 18 Nov 2019 11:56:02 -0700 Subject: [PATCH 3/7] Move install and tests into scripts --- .travis.yml | 7 ++----- ci/install_travis.sh | 35 +++++++++++++++++++++++++++++++++++ ci/test_travis.sh | 11 +++++++++++ 3 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 ci/install_travis.sh create mode 100755 ci/test_travis.sh 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 From 7768667dc0a13caf771f229a9c079454a724bdc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Mon, 18 Nov 2019 12:03:09 -0700 Subject: [PATCH 4/7] Install GL/gl.h --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 32eea85706..f4573dc8e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,8 +58,16 @@ matrix: os: osx - compiler: clang os: linux + addons: + apt: + packages: + - libglu1-mesa-dev - compiler: gcc os: linux + addons: + apt: + packages: + - libglu1-mesa-dev install: - source ci/install_travis.sh From 97e90919f6884434654706a6713d61a6ee86be5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Mon, 18 Nov 2019 12:09:39 -0700 Subject: [PATCH 5/7] Upgrade macOS to 10.12 (Qt requires that) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f4573dc8e9..27dc0affed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ os: - linux - osx dist: xenial -osx_image: xcode7.3 +osx_image: xcode8.3 matrix: exclude: From 18f454f1b2c86d9d0d7c96297abfc2076079bd9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Mon, 18 Nov 2019 12:17:24 -0700 Subject: [PATCH 6/7] Only use clang on macOS The gcc version was using clang underneath also. If we wanted to use gcc, we would need to ensure cmake picks it up properly. We do not really need to test gcc on macOS, as long as things build correctly there with the default compiler (clang). --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27dc0affed..13cc22027f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,8 +54,6 @@ matrix: - echo "" > html/.nojekyll - compiler: clang os: osx - - compiler: gcc - os: osx - compiler: clang os: linux addons: From bbc6238029b841fa7e9298b27a6512ad39533c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Mon, 18 Nov 2019 12:23:24 -0700 Subject: [PATCH 7/7] Do not use "set -e" for the activate script --- ci/install_travis.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ci/install_travis.sh b/ci/install_travis.sh index 481d674367..5075f061e6 100644 --- a/ci/install_travis.sh +++ b/ci/install_travis.sh @@ -26,10 +26,12 @@ 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 + +source activate $our_install_dir + +cd $SOURCE_DIR; +