diff options
Diffstat (limited to '.travis.yml')
-rw-r--r-- | .travis.yml | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/.travis.yml b/.travis.yml index d1a62c7f..9982be30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,18 +19,15 @@ env: - CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=$DESTDIR/usr" - VALGRIND="valgrind --tool=memcheck --leak-check=yes --gen-suppressions=all --suppressions=tests/.valgrind.supp $VALGRIND_OPTIONS" -matrix: +matrix: # TODO: consider parallel execution, this thing takes an hour to run include: - os: linux compiler: gcc - os: linux - compiler: gcc - env: [ 'E2EE="-DQuotient_ENABLE_E2EE=ON"', 'UPDATE_API=1' ] - - os: linux compiler: clang - os: osx osx_image: xcode10.1 - env: [ 'PATH=/usr/local/opt/qt/bin:$PATH', 'VALGRIND=' ] + env: [ 'E2EE=1', 'VALGRIND=' ] addons: homebrew: update: true @@ -41,15 +38,32 @@ matrix: cache: directories: - $HOME/Library/Caches/Homebrew + # Check a few more advanced configurations + - os: linux + compiler: gcc + env: [ E2EE=1, UPDATE_API=1 ] # Check UPDATE_API with one of fatter options + - os: linux + compiler: clang + env: [ E2EE=1 ] + - os: linux + compiler: gcc + env: [ E2EE=1 ] before_install: - if [ -f "$(which ninja)" ]; then export CMAKE_ARGS="$CMAKE_ARGS -GNinja"; fi +- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export PATH=/usr/local/opt/qt/bin:$PATH; fi # The recent GTAD uses std::filesystem that's not available in stock bionic - | if [ -n "$UPDATE_API" ]; then export CC=gcc-8 CXX=g++-8 export CMAKE_UPDATE_API_ARGS="-DMATRIX_DOC_PATH=../matrix-doc -DGTAD_PATH=../gtad/gtad" fi +- | + if [ -n "$E2EE" ]; then + export CMAKE_E2EE_ARGS="-DQuotient_ENABLE_E2EE=ON" + export QMAKE_E2EE_ARGS='"DEFINES += Quotient_E2EE_ENABLED USE_INTREE_LIBQOLM" "INCLUDEPATH += olm/include" "LIBS += -Lolm/build"' + export LIB_PATH_E2EE=olm/build + fi # RPM spec-style: swallow a command with default parameters into an alias # and add/override parameters further in the code if/as necessary - shopt -s expand_aliases @@ -58,11 +72,14 @@ before_install: install: - pushd .. # Go out of libQuotient source tree -- git clone https://gitlab.matrix.org/matrix-org/olm.git -- pushd olm -- _cmake_config -- _cmake_build --target install -- popd +- | + if [ -n "$E2EE" ]; then + git clone https://gitlab.matrix.org/matrix-org/olm.git + pushd olm + _cmake_config + _cmake_build --target install + popd + fi - | if [ -n "$UPDATE_API" ]; then @@ -76,7 +93,7 @@ install: - popd # back to libQuotient source tree before_script: -- _cmake_config $CMAKE_UPDATE_API_ARGS $E2EE +- _cmake_config $CMAKE_UPDATE_API_ARGS $CMAKE_E2EE_ARGS - if [ -n "$UPDATE_API" ]; then _cmake_build --target update-api; fi script: @@ -85,10 +102,10 @@ script: - cmake $CMAKE_ARGS tests -Bbuild-test - cmake --build build-test --target all # Build with qmake -- qmake quotest.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += olm/include" "LIBS += -Lbuild/lib" "LIBS += -Lolm/build" +- qmake -Wall quotest.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" -- $QMAKE_E2EE_ARGS - make all # Run the qmake-compiled quotest under valgrind -- if [ "$TEST_USER" != "" ]; then LD_LIBRARY_PATH="olm/build" $VALGRIND ./quotest "$TEST_USER" "$TEST_PWD" quotest-travis '#quotest:matrix.org' "Travis CI job $TRAVIS_JOB_NUMBER"; fi +- if [ "$TEST_USER" != "" ]; then LD_LIBRARY_PATH="$LIB_PATH_E2EE" $VALGRIND ./quotest "$TEST_USER" "$TEST_PWD" quotest-travis '#quotest:matrix.org' "Travis CI job $TRAVIS_JOB_NUMBER"; fi notifications: webhooks: |