language: cpp dist: bionic git: depth: false before_cache: - brew cleanup cache: directories: - $HOME/Library/Caches/Homebrew addons: apt: packages: - ninja-build - qt5-default - 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 compiler: gcc - os: linux compiler: clang - os: osx osx_image: xcode10.1 env: [ 'PATH=/usr/local/opt/qt/bin:$PATH' ] addons: homebrew: update: true packages: - qt5 before_install: - eval "${ENV_EVAL}" - 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_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 $CMAKE_ARGS . - cmake --build . - popd before_script: - $_CMAKE_CONFIG -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" -DOlm_DIR=olm/build - $_CMAKE_BUILD --target update-api script: - $_CMAKE_BUILD_INSTALL # Build qmc-example with the installed library - 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/build" - make all # Run the qmake-compiled qmc-example under valgrind - 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: urls: - "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MGtpdHN1bmUlM0FtYXRyaXgub3JnLyUyMVBDelV0eHRPalV5U3hTZWxvZiUzQW1hdHJpeC5vcmc" on_success: change # always|never|change on_failure: always on_start: never