From f38d4c9c6bf5596c2ef36528a1b2d2e77e1b5a09 Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Wed, 16 Jan 2019 21:53:22 +0000 Subject: [PATCH 01/14] Use container builds for Linux builds Replaces the apt-get command with the apt addon. --- .travis.yml | 25 +++++++++++++++++++++++-- ci/travis-setup.sh | 10 ---------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e05d1eea7b..cc79a94f3be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,12 @@ -language: c +# Configuration file for TravisCI + +# Use the container builds so we don't need sudo priviledges +sudo: false -sudo: required +language: c +# Only build pushes to select branches and tags. This avoids the double +# builds than happen when working on a branch instead of a fork. branches: only: - master @@ -13,6 +18,22 @@ os: - linux #- osx +addons: + # Dependencies for the Linux builds + apt: + packages: + - cmake + - build-essential + - libcurl4-gnutls-dev + - libnetcdf-dev + - libgdal1-dev + - libfftw3-dev + - libpcre3-dev + - liblapack-dev + - ghostscript + - curl + - graphicsmagick + env: global: - INSTALLDIR="$HOME/gmt-install-dir" diff --git a/ci/travis-setup.sh b/ci/travis-setup.sh index ccb5abf5cde..8a5eeb73033 100644 --- a/ci/travis-setup.sh +++ b/ci/travis-setup.sh @@ -4,16 +4,6 @@ # To return a failure if any commands inside fail set -e -# Install dependencies -if [ "$TRAVIS_OS_NAME" == "linux" ]; then - sudo apt-get update - sudo apt-get install -y build-essential cmake libcurl4-gnutls-dev libnetcdf-dev \ - libgdal1-dev libfftw3-dev libpcre3-dev liblapack-dev ghostscript curl \ - graphicsmagick -else - echo "OSX not supported yet"; -fi - # Get the coastlines and country polygons EXT="tar.gz" GSHHG="gshhg-gmt-2.3.7" From 37c33b35c122bee548908bcc9d0ff9512d85651a Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Wed, 16 Jan 2019 22:19:36 +0000 Subject: [PATCH 02/14] Reorganize the Travis build matrix and scripts Make the build matrix more explicit. Only check if it's a cron job when setting the variables for build actions. This way, we can overwrite that to run full builds by setting those variables to "true". Rename the build scripts to more descriptive names. --- .travis.yml | 34 ++++++++++++++----- ci/{travis-build.sh => build-gmt.sh} | 0 ...travis-setup.sh => download-coastlines.sh} | 5 +-- 3 files changed, 26 insertions(+), 13 deletions(-) rename ci/{travis-build.sh => build-gmt.sh} (100%) rename ci/{travis-setup.sh => download-coastlines.sh} (90%) diff --git a/.travis.yml b/.travis.yml index cc79a94f3be..bdc883ca32c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,38 +34,54 @@ addons: - curl - graphicsmagick +# Define environment variables common to all builds env: global: - INSTALLDIR="$HOME/gmt-install-dir" - COASTLINEDIR="$HOME/gmt-install-dir/coast" - PATH="$INSTALLDIR/bin:$PATH" - LD_LIBRARY_PATH="$INSTALLDIR/lib:$LD_LIBRARY_PATH" + - PYTHON=3.6 + - CONDA_INSTALL_EXTRA="sphinx" + - COVERAGE=true - if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then - export PYTHON=3.6 - export CONDA_INSTALL_EXTRA="sphinx" - export COVERAGE=true + export BUILD_DOCS=true + export TEST_ALL=true + else + export BUILD_DOCS=false + export TEST_ALL=false fi +# Setup the build environment before_install: - # Install GMT dependencies - - bash ci/travis-setup.sh + - mkdir "$INSTALLDIR" + - mkdir "$COASTLINEDIR" + - bash ci/download-coastlines.sh # Install GMT documentation dependencies - - if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then + - if [ "$BUILD_DOCS" == "true" ]; then git clone https://github.com/fatiando/continuous-integration.git; source continuous-integration/travis/setup-miniconda.sh; fi +# Install the package that we want to test install: # Build and install GMT - - bash ci/travis-build.sh; + - bash ci/build-gmt.sh; +# Run the actual tests and checks script: - gmt defaults -Vd - gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -P -Vd > test.ps - # Build documentations, tests and coverage reports - - if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then + - if [ "$BUILD_DOCS" == "true" ]; then cd build; make -j docs_html; cd ..; + fi + - if [ "$TEST_ALL" == "true" ]; then cd build; make -j check; cd ..; + fi + +# Things to do if the build is successful +after_success: + - if [ "$TEST_ALL" == "true" ]; then bash <(curl -s https://codecov.io/bash); fi diff --git a/ci/travis-build.sh b/ci/build-gmt.sh similarity index 100% rename from ci/travis-build.sh rename to ci/build-gmt.sh diff --git a/ci/travis-setup.sh b/ci/download-coastlines.sh similarity index 90% rename from ci/travis-setup.sh rename to ci/download-coastlines.sh index 8a5eeb73033..afef73fa1cd 100644 --- a/ci/travis-setup.sh +++ b/ci/download-coastlines.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Setup TravisCI to be able to build and test GMT +# Download and install the coastlines and boundaries datasets # To return a failure if any commands inside fail set -e @@ -9,9 +9,6 @@ EXT="tar.gz" GSHHG="gshhg-gmt-2.3.7" DCW="dcw-gmt-1.1.4" -mkdir $INSTALLDIR -mkdir $COASTLINEDIR - # GSHHG (coastlines, rivers, and political boundaries): echo "" echo "Downloading and unpacking GSHHG" From a50f2e218087e1ec32e9ce757bd64f55b2c2f56c Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Wed, 16 Jan 2019 22:32:36 +0000 Subject: [PATCH 03/14] Build the docs using the system Python Avoid downloading and installing miniconda. --- .travis.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index bdc883ca32c..031f5bf18d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,9 @@ os: - linux #- osx +# Set the Ubuntu version for the Linux builds +dist: xenial + addons: # Dependencies for the Linux builds apt: @@ -33,6 +36,8 @@ addons: - ghostscript - curl - graphicsmagick + - python + - python-sphinx # Define environment variables common to all builds env: @@ -51,6 +56,7 @@ env: export BUILD_DOCS=false export TEST_ALL=false fi + - BUILD_DOCS=true # Setup the build environment before_install: @@ -58,10 +64,10 @@ before_install: - mkdir "$COASTLINEDIR" - bash ci/download-coastlines.sh # Install GMT documentation dependencies - - if [ "$BUILD_DOCS" == "true" ]; then - git clone https://github.com/fatiando/continuous-integration.git; - source continuous-integration/travis/setup-miniconda.sh; - fi + #- if [ "$BUILD_DOCS" == "true" ]; then + #git clone https://github.com/fatiando/continuous-integration.git; + #source continuous-integration/travis/setup-miniconda.sh; + #fi # Install the package that we want to test install: From 691ec85de0b9b6fc0a53bbbb6422cf0f56cc82ee Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Wed, 16 Jan 2019 22:44:31 +0000 Subject: [PATCH 04/14] Separate cd commands so build fails if doc fails --- .travis.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 031f5bf18d1..c5e02ca4ab7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ addons: - curl - graphicsmagick - python + - python-pip - python-sphinx # Define environment variables common to all builds @@ -50,11 +51,11 @@ env: - CONDA_INSTALL_EXTRA="sphinx" - COVERAGE=true - if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then - export BUILD_DOCS=true - export TEST_ALL=true + export BUILD_DOCS=true + export TEST_ALL=true else - export BUILD_DOCS=false - export TEST_ALL=false + export BUILD_DOCS=false + export TEST_ALL=false fi - BUILD_DOCS=true @@ -65,6 +66,7 @@ before_install: - bash ci/download-coastlines.sh # Install GMT documentation dependencies #- if [ "$BUILD_DOCS" == "true" ]; then + #pip install --user sphinx #git clone https://github.com/fatiando/continuous-integration.git; #source continuous-integration/travis/setup-miniconda.sh; #fi @@ -78,12 +80,14 @@ install: script: - gmt defaults -Vd - gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -P -Vd > test.ps + - cd build - if [ "$BUILD_DOCS" == "true" ]; then - cd build; make -j docs_html; cd ..; + make -j docs_html; fi - if [ "$TEST_ALL" == "true" ]; then - cd build; make -j check; cd ..; + make -j check; fi + - cd .. # Things to do if the build is successful after_success: From 25f92a577c3f11e154c0301f47c4e41f72f373f3 Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Wed, 16 Jan 2019 22:54:23 +0000 Subject: [PATCH 05/14] Use pip to install sphinx --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5e02ca4ab7..06ad2de7e39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,6 @@ addons: - graphicsmagick - python - python-pip - - python-sphinx # Define environment variables common to all builds env: @@ -65,11 +64,11 @@ before_install: - mkdir "$COASTLINEDIR" - bash ci/download-coastlines.sh # Install GMT documentation dependencies - #- if [ "$BUILD_DOCS" == "true" ]; then - #pip install --user sphinx + - if [ "$BUILD_DOCS" == "true" ]; then + pip install --user sphinx #git clone https://github.com/fatiando/continuous-integration.git; #source continuous-integration/travis/setup-miniconda.sh; - #fi + fi # Install the package that we want to test install: From 5c421fa9ba0aee5e2787998dca615940c0d609a0 Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Wed, 16 Jan 2019 22:56:16 +0000 Subject: [PATCH 06/14] Remove extra comments --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 06ad2de7e39..f9a2a2e0603 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,8 @@ os: # Set the Ubuntu version for the Linux builds dist: xenial +# Dependencies for the Linux and OSX builds addons: - # Dependencies for the Linux builds apt: packages: - cmake @@ -46,8 +46,6 @@ env: - COASTLINEDIR="$HOME/gmt-install-dir/coast" - PATH="$INSTALLDIR/bin:$PATH" - LD_LIBRARY_PATH="$INSTALLDIR/lib:$LD_LIBRARY_PATH" - - PYTHON=3.6 - - CONDA_INSTALL_EXTRA="sphinx" - COVERAGE=true - if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then export BUILD_DOCS=true @@ -66,8 +64,6 @@ before_install: # Install GMT documentation dependencies - if [ "$BUILD_DOCS" == "true" ]; then pip install --user sphinx - #git clone https://github.com/fatiando/continuous-integration.git; - #source continuous-integration/travis/setup-miniconda.sh; fi # Install the package that we want to test From ec7cdf9adb1111ed15f5aac30225a1ee13a711b4 Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Wed, 16 Jan 2019 23:03:47 +0000 Subject: [PATCH 07/14] Missing a ; --- .travis.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index f9a2a2e0603..d969c2d4ae7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,18 @@ addons: - graphicsmagick - python - python-pip + #homebrew: + #packages: + #- cmake + #- curl + #- netcdf + #- gdal + #- fftw + #- pcre2 + #- ghostscript + #- curl + #- graphicsmagick + #- python # Define environment variables common to all builds env: @@ -47,12 +59,12 @@ env: - PATH="$INSTALLDIR/bin:$PATH" - LD_LIBRARY_PATH="$INSTALLDIR/lib:$LD_LIBRARY_PATH" - COVERAGE=true - - if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then - export BUILD_DOCS=true - export TEST_ALL=true + - if [ "$TRAVIS_EVENT_TYPE" == "cron" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then + export BUILD_DOCS=true; + export TEST_ALL=true; else - export BUILD_DOCS=false - export TEST_ALL=false + export BUILD_DOCS=false; + export TEST_ALL=false; fi - BUILD_DOCS=true @@ -63,7 +75,7 @@ before_install: - bash ci/download-coastlines.sh # Install GMT documentation dependencies - if [ "$BUILD_DOCS" == "true" ]; then - pip install --user sphinx + pip install --user sphinx; fi # Install the package that we want to test From a5a363756699ac04ca85a7b5f6c00314cba55f81 Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Wed, 16 Jan 2019 23:31:19 +0000 Subject: [PATCH 08/14] Test on OSX --- .travis.yml | 66 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index d969c2d4ae7..4678bef30e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,10 +14,6 @@ branches: # Regex to build tagged commits with version numbers - /\d+\.\d+(\.\d+)?(\S*)?$/ -os: - - linux - #- osx - # Set the Ubuntu version for the Linux builds dist: xenial @@ -38,18 +34,18 @@ addons: - graphicsmagick - python - python-pip - #homebrew: - #packages: - #- cmake - #- curl - #- netcdf - #- gdal - #- fftw - #- pcre2 - #- ghostscript - #- curl - #- graphicsmagick - #- python + homebrew: + packages: + - cmake + - curl + - netcdf + - gdal + - fftw + - pcre2 + - ghostscript + - curl + - graphicsmagick + - python # Define environment variables common to all builds env: @@ -59,14 +55,26 @@ env: - PATH="$INSTALLDIR/bin:$PATH" - LD_LIBRARY_PATH="$INSTALLDIR/lib:$LD_LIBRARY_PATH" - COVERAGE=true - - if [ "$TRAVIS_EVENT_TYPE" == "cron" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then - export BUILD_DOCS=true; - export TEST_ALL=true; - else - export BUILD_DOCS=false; - export TEST_ALL=false; - fi - - BUILD_DOCS=true + - BUILD_DOCS=false + - TEST=false + +# Specify the build configurations. Be sure to only deploy from a single build. +matrix: + include: + - name: "Linux" + os: linux + env: + - if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then + export BUILD_DOCS=true; + export TEST="all"; + fi + - name: "Mac" + os: osx + env: + - if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then + export TEST="all"; + fi + # Setup the build environment before_install: @@ -85,20 +93,20 @@ install: # Run the actual tests and checks script: + - cd build - gmt defaults -Vd - gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -P -Vd > test.ps - - cd build + - if [ "$TEST" == "all" ]; then + make -j check; + fi - if [ "$BUILD_DOCS" == "true" ]; then make -j docs_html; fi - - if [ "$TEST_ALL" == "true" ]; then - make -j check; - fi - cd .. # Things to do if the build is successful after_success: - - if [ "$TEST_ALL" == "true" ]; then + - if [ "$TEST" == "all" ]; then bash <(curl -s https://codecov.io/bash); fi From fa67c9108bb876e1f363c60fd2168f328cdc291c Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Thu, 17 Jan 2019 00:15:48 +0000 Subject: [PATCH 09/14] Separate jobs for building docs and testing Testing is known to be failing so use a different job to build and deploy docs. --- .travis.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4678bef30e8..2447ebfb346 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,7 @@ addons: - graphicsmagick - python -# Define environment variables common to all builds +# Define environment variables and set build actions env: global: - INSTALLDIR="$HOME/gmt-install-dir" @@ -58,23 +58,31 @@ env: - BUILD_DOCS=false - TEST=false -# Specify the build configurations. Be sure to only deploy from a single build. +# Create the build matrix with different jobs for each platform and cron jobs matrix: include: - name: "Linux" os: linux + if: type != cron + - name: "Linux" + os: linux + if: type = cron env: - - if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then - export BUILD_DOCS=true; - export TEST="all"; - fi + - TEST="all" - name: "Mac" os: osx + if: type != cron + - name: "Max" + os: osx + if: type = cron env: - - if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then - export TEST="all"; - fi - + - TEST="all" + # Only build the docs on Linux cron jobs + - name: "Linux - Build docs" + os: linux + if: type = cron + env: + - BUILD_DOCS=true # Setup the build environment before_install: From 0c139229336406672ab1a9fe141ec8595323a2ff Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Thu, 17 Jan 2019 00:31:47 +0000 Subject: [PATCH 10/14] Try same hack needed for the conda-forge builds --- ci/build-gmt.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ci/build-gmt.sh b/ci/build-gmt.sh index 93d8141586c..dfe3efe98f4 100644 --- a/ci/build-gmt.sh +++ b/ci/build-gmt.sh @@ -34,5 +34,19 @@ cmake .. make -j make install +# We are fixing the paths to dynamic library files inside library and binary +# files because something in 'make install' is doubling up the path to the +# library files. This only happens on OSX. Anyone who knows how to solve that +# problem is free to contact the maintainers. +if [[ "$TRAVIS_OS_NAME" == "osx" ]];then + install_name_tool -id $INSTALLDIR/lib/libgmt.6.dylib $INSTALLDIR/lib/libgmt.6.dylib + install_name_tool -id $INSTALLDIR/lib/libpostscriptlight.6.dylib $INSTALLDIR/lib/libpostscriptlight.6.dylib + install_name_tool -change $INSTALLDIR/$INSTALLDIR/lib/libgmt.6.dylib $INSTALLDIR/lib/libgmt.6.dylib $INSTALLDIR/lib/gmt/plugins/supplements.so + install_name_tool -change $INSTALLDIR/$INSTALLDIR/lib/libpostscriptlight.6.dylib $INSTALLDIR/lib/libpostscriptlight.6.dylib $INSTALLDIR/lib/gmt/plugins/supplements.so + install_name_tool -change $INSTALLDIR/$INSTALLDIR/lib/libgmt.6.dylib $INSTALLDIR/lib/libgmt.6.dylib $INSTALLDIR/bin/gmt + install_name_tool -change $INSTALLDIR/$INSTALLDIR/lib/libpostscriptlight.6.dylib $INSTALLDIR/lib/libpostscriptlight.6.dylib $INSTALLDIR/bin/gmt + install_name_tool -change $INSTALLDIR/$INSTALLDIR/lib/libpostscriptlight.6.dylib $INSTALLDIR/lib/libpostscriptlight.6.dylib $INSTALLDIR/lib/libgmt.6.dylib +fi + # Turn off exit on failure. set +e From c4de6142544189b65bcf04fc7a55c102c1d7a9dd Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Thu, 17 Jan 2019 00:45:33 +0000 Subject: [PATCH 11/14] Trigger the longer builds just to test them --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2447ebfb346..734cef5d7fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,7 +66,7 @@ matrix: if: type != cron - name: "Linux" os: linux - if: type = cron + #if: type = cron env: - TEST="all" - name: "Mac" @@ -74,13 +74,13 @@ matrix: if: type != cron - name: "Max" os: osx - if: type = cron + #if: type = cron env: - TEST="all" # Only build the docs on Linux cron jobs - name: "Linux - Build docs" os: linux - if: type = cron + #if: type = cron env: - BUILD_DOCS=true From c765dde9bac8281712812f328224e0dfd0b75e9c Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Thu, 17 Jan 2019 10:54:41 +0000 Subject: [PATCH 12/14] Remove dublicate cmake config + always upload coverage --- .travis.yml | 26 ++++++++++++++------------ ci/build-gmt.sh | 1 - 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 734cef5d7fe..456aa40e29a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,26 +61,26 @@ env: # Create the build matrix with different jobs for each platform and cron jobs matrix: include: - - name: "Linux" + - name: "Linux (compile only)" os: linux if: type != cron - - name: "Linux" + - name: "Linux (cron)" os: linux - #if: type = cron + if: type = cron env: - TEST="all" - - name: "Mac" + - name: "Mac (compile only)" os: osx if: type != cron - - name: "Max" + - name: "Mac (cron)" os: osx - #if: type = cron + if: type = cron env: - TEST="all" # Only build the docs on Linux cron jobs - - name: "Linux - Build docs" + - name: "Linux (cron - build docs)" os: linux - #if: type = cron + if: type = cron env: - BUILD_DOCS=true @@ -107,16 +107,18 @@ script: - if [ "$TEST" == "all" ]; then make -j check; fi + # Upload test coverage even if build fails. Keep separate to make sure this task + # fails if the tests fail. + - if [ "$TEST" == "all" ]; then + bash <(curl -s https://codecov.io/bash); + fi - if [ "$BUILD_DOCS" == "true" ]; then make -j docs_html; fi - cd .. # Things to do if the build is successful -after_success: - - if [ "$TEST" == "all" ]; then - bash <(curl -s https://codecov.io/bash); - fi +#after_success: notifications: email: false diff --git a/ci/build-gmt.sh b/ci/build-gmt.sh index dfe3efe98f4..77519baf31b 100644 --- a/ci/build-gmt.sh +++ b/ci/build-gmt.sh @@ -20,7 +20,6 @@ EOF if [ "$COVERAGE" == "true" ]; then cat >> cmake/ConfigUser.cmake << 'EOF' -set (CMAKE_BUILD_TYPE Debug) set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement -coverage -O0") EOF fi From a6db749d4ebc377632faa6b2e585da417b469f2f Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Thu, 17 Jan 2019 19:04:43 +0000 Subject: [PATCH 13/14] Remove the COVERAGE variable and use TEST instead --- .travis.yml | 15 +++++++-------- ci/build-gmt.sh | 10 ++++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 456aa40e29a..77e7d55355d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,7 +54,6 @@ env: - COASTLINEDIR="$HOME/gmt-install-dir/coast" - PATH="$INSTALLDIR/bin:$PATH" - LD_LIBRARY_PATH="$INSTALLDIR/lib:$LD_LIBRARY_PATH" - - COVERAGE=true - BUILD_DOCS=false - TEST=false @@ -66,21 +65,21 @@ matrix: if: type != cron - name: "Linux (cron)" os: linux - if: type = cron + #if: type = cron env: - - TEST="all" + - TEST="true" - name: "Mac (compile only)" os: osx if: type != cron - name: "Mac (cron)" os: osx - if: type = cron + #if: type = cron env: - - TEST="all" + - TEST="true" # Only build the docs on Linux cron jobs - name: "Linux (cron - build docs)" os: linux - if: type = cron + #if: type = cron env: - BUILD_DOCS=true @@ -104,12 +103,12 @@ script: - cd build - gmt defaults -Vd - gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -P -Vd > test.ps - - if [ "$TEST" == "all" ]; then + - if [ "$TEST" == "true" ]; then make -j check; fi # Upload test coverage even if build fails. Keep separate to make sure this task # fails if the tests fail. - - if [ "$TEST" == "all" ]; then + - if [ "$TEST" == "true" ]; then bash <(curl -s https://codecov.io/bash); fi - if [ "$BUILD_DOCS" == "true" ]; then diff --git a/ci/build-gmt.sh b/ci/build-gmt.sh index 77519baf31b..a757c5fcae6 100644 --- a/ci/build-gmt.sh +++ b/ci/build-gmt.sh @@ -9,22 +9,24 @@ set (CMAKE_INSTALL_PREFIX "$ENV{INSTALLDIR}") set (GMT_LIBDIR "$ENV{INSTALLDIR}/lib") set (DCW_ROOT "$ENV{COASTLINEDIR}") set (GSHHG_ROOT "$ENV{COASTLINEDIR}") +EOF +if [ "$TEST" == "true" ]; then + cat >> cmake/ConfigUser.cmake << 'EOF' set (CMAKE_BUILD_TYPE Debug) enable_testing() set (DO_EXAMPLES TRUE) set (DO_TESTS TRUE) set (DO_ANIMATIONS TRUE) set (N_TEST_JOBS 2) -EOF - -if [ "$COVERAGE" == "true" ]; then - cat >> cmake/ConfigUser.cmake << 'EOF' set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement -coverage -O0") EOF fi +echo "" +echo "Using the following cmake configuration:" cat cmake/ConfigUser.cmake +echo "" mkdir build && cd build From 956480c5b3b9fc4130ed8aacfbc339c6594fbc5c Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Thu, 17 Jan 2019 19:48:32 +0000 Subject: [PATCH 14/14] Revert the long jobs back to cron --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 77e7d55355d..31378ab0df4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,7 +65,7 @@ matrix: if: type != cron - name: "Linux (cron)" os: linux - #if: type = cron + if: type = cron env: - TEST="true" - name: "Mac (compile only)" @@ -73,13 +73,13 @@ matrix: if: type != cron - name: "Mac (cron)" os: osx - #if: type = cron + if: type = cron env: - TEST="true" # Only build the docs on Linux cron jobs - name: "Linux (cron - build docs)" os: linux - #if: type = cron + if: type = cron env: - BUILD_DOCS=true