diff options
Diffstat (limited to '.travis.yml')
-rw-r--r-- | .travis.yml | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/.travis.yml b/.travis.yml index 68118423..3f6aa27d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,17 @@ addons: - qtmultimedia5-dev - valgrind +env: + global: + - DESTDIR="$TRAVIS_BUILD_DIR/install" + - CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=$DESTDIR/usr" + - VALGRIND_OPTIONS="--tool=memcheck --leak-check=yes --gen-suppressions=all --suppressions=.valgrind.qmc-example.supp" + # RPM spec-style: swallow a command with default parameters into a variable + # and add/override parameters further in the code if/as necessary + - _CMAKE_CONFIG="cmake $CMAKE_ARGS . -Bbuild" + - _CMAKE_BUILD="cmake --build build" + - _CMAKE_BUILD_INSTALL="$_CMAKE_BUILD --target install" + matrix: include: - os: linux @@ -36,42 +47,37 @@ matrix: before_install: - eval "${ENV_EVAL}" -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then USE_NINJA="-GNinja"; fi +- if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CMAKE_ARGS="$CMAKE_ARGS -GNinja"; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then VALGRIND="valgrind $VALGRIND_OPTIONS"; fi install: - git clone https://gitlab.matrix.org/matrix-org/olm.git - pushd olm -- cmake . -Bbuild -DBUILD_SHARED_LIBS=NO -DCMAKE_INSTALL_PREFIX=install -- cmake --build build -- cmake --build build --target install +- $_CMAKE_CONFIG +- $_CMAKE_BUILD +#- $_CMAKE_BUILD_INSTALL - popd - git clone https://github.com/quotient-im/matrix-doc.git - git clone --recursive https://github.com/KitsuneRal/gtad.git - pushd gtad -- cmake $USE_NINJA -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} . +- cmake $CMAKE_ARGS . - cmake --build . - popd before_script: -- mkdir build && pushd build -- cmake $USE_NINJA -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_INSTALL_PREFIX=../install -DOlm_DIR=../olm/install/lib/cmake/Olm .. -- cmake --build . --target update-api -- popd +- $_CMAKE_CONFIG -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" -DOlm_DIR=olm/build +- $_CMAKE_BUILD --target update-api script: -- cmake --build build --target all -- cmake --build build --target install +- $_CMAKE_BUILD_INSTALL # Build qmc-example with the installed library -- mkdir build-example && pushd build-example -- cmake -DCMAKE_PREFIX_PATH=../install -DOlm_DIR=../olm/install/lib/cmake/Olm ../examples -- cmake --build . --target all -- popd +- cmake $CMAKE_ARGS examples -Bbuild-example -DOlm_DIR=olm/build +- cmake --build build-example --target all # Build with qmake -- qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += olm/include" "LIBS += -Lbuild/lib" "LIBS += -Lolm/install/lib" +- qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += olm/include" "LIBS += -Lbuild/lib" "LIBS += -Lolm/build" - make all # Run the qmake-compiled qmc-example under valgrind -- if [ "$QMC_TEST_USER" != "" ]; then LD_LIBRARY_PATH="build/lib" $VALGRIND ./qmc-example "$QMC_TEST_USER" "$QMC_TEST_PWD" qmc-example-travis '#qmc-test:matrix.org' "Travis CI job $TRAVIS_JOB_NUMBER"; fi +- if [ "$QMC_TEST_USER" != "" ]; then LD_LIBRARY_PATH="olm/build" $VALGRIND ./qmc-example "$QMC_TEST_USER" "$QMC_TEST_PWD" qmc-example-travis '#qmc-test:matrix.org' "Travis CI job $TRAVIS_JOB_NUMBER"; fi notifications: webhooks: |