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
This commit is contained in:
Geert Janssens 2017-09-02 11:05:30 +02:00
parent 14b72ea11d
commit 0e0e4d294e

View File

@ -3,6 +3,10 @@ language: c
compiler: compiler:
- gcc - gcc
# - clang # - clang
env:
- BUILDTYPE=cmake-make
- BUILDTYPE=cmake-ninja
- BUILDTYPE=autotools
before_install: before_install:
- sudo apt-get update -qq - sudo apt-get update -qq
- sudo apt-get build-dep -qq gnucash - sudo apt-get build-dep -qq gnucash
@ -13,22 +17,26 @@ script: |
set -ev set -ev
# First, do the cmake build using the default Makefile generator # First, do the cmake build using the default Makefile generator
mkdir /tmp/gnucash-build-cmake-make if [[ "$BUILDTYPE" == "cmake-make" ]]; then
cd /tmp/gnucash-build-cmake-make mkdir /tmp/gnucash-build-cmake-make
cmake $TRAVIS_BUILD_DIR cd /tmp/gnucash-build-cmake-make
make -j 4 cmake $TRAVIS_BUILD_DIR
make check make -j 4
make check
# Next, do cmake again, using the Ninja generator this time # Next, do cmake again, using the Ninja generator this time
mkdir /tmp/gnucash-build-cmake-ninja elif [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
cd /tmp/gnucash-build-cmake-ninja mkdir /tmp/gnucash-build-cmake-ninja
cmake -G Ninja $TRAVIS_BUILD_DIR cd /tmp/gnucash-build-cmake-ninja
ninja cmake -G Ninja $TRAVIS_BUILD_DIR
ninja check ninja
ninja check
# Finally, do the autotools build # Finally, do the autotools build
cd $TRAVIS_BUILD_DIR elif [[ "$BUILDTYPE" == "autotools" ]]; then
./autogen.sh cd $TRAVIS_BUILD_DIR
./configure ./autogen.sh
make ./configure
make check make
make check
fi