From 0e0e4d294e493911004f2e5c53eeedc798fa92a4 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Sat, 2 Sep 2017 11:05:30 +0200 Subject: [PATCH] Set up a build matrix on Travis CI This will run the different builds in parallel (depending on resource availability on Travis). The advantages are - faster test results - easier to spot which build type has failed - shorter test log per build type to parse --- .travis.yml | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b903b0049..cd1626a02f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,10 @@ language: c compiler: - gcc # - clang +env: + - BUILDTYPE=cmake-make + - BUILDTYPE=cmake-ninja + - BUILDTYPE=autotools before_install: - sudo apt-get update -qq - sudo apt-get build-dep -qq gnucash @@ -13,22 +17,26 @@ script: | set -ev # First, do the cmake build using the default Makefile generator - mkdir /tmp/gnucash-build-cmake-make - cd /tmp/gnucash-build-cmake-make - cmake $TRAVIS_BUILD_DIR - make -j 4 - make check + if [[ "$BUILDTYPE" == "cmake-make" ]]; then + mkdir /tmp/gnucash-build-cmake-make + cd /tmp/gnucash-build-cmake-make + cmake $TRAVIS_BUILD_DIR + make -j 4 + make check # Next, do cmake again, using the Ninja generator this time - mkdir /tmp/gnucash-build-cmake-ninja - cd /tmp/gnucash-build-cmake-ninja - cmake -G Ninja $TRAVIS_BUILD_DIR - ninja - ninja check + elif [[ "$BUILDTYPE" == "cmake-ninja" ]]; then + mkdir /tmp/gnucash-build-cmake-ninja + cd /tmp/gnucash-build-cmake-ninja + cmake -G Ninja $TRAVIS_BUILD_DIR + ninja + ninja check # Finally, do the autotools build - cd $TRAVIS_BUILD_DIR - ./autogen.sh - ./configure - make - make check + elif [[ "$BUILDTYPE" == "autotools" ]]; then + cd $TRAVIS_BUILD_DIR + ./autogen.sh + ./configure + make + make check + fi