aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml43
1 files changed, 19 insertions, 24 deletions
diff --git a/.travis.yml b/.travis.yml
index 3f6aa27d..21b2fd64 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,13 +4,6 @@ dist: bionic
git:
depth: false
-before_cache:
-- brew cleanup
-
-cache:
- directories:
- - $HOME/Library/Caches/Homebrew
-
addons:
apt:
packages:
@@ -23,12 +16,7 @@ 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"
+ - VALGRIND="valgrind --tool=memcheck --leak-check=yes --gen-suppressions=all --suppressions=.valgrind.qmc-example.supp $VALGRIND_OPTIONS"
matrix:
include:
@@ -38,24 +26,31 @@ matrix:
compiler: clang
- os: osx
osx_image: xcode10.1
- env: [ 'PATH=/usr/local/opt/qt/bin:$PATH' ]
+ env: [ 'PATH=/usr/local/opt/qt/bin:$PATH', 'VALGRIND=' ]
addons:
homebrew:
update: true
packages:
- qt5
+ before_cache:
+ - brew cleanup
+ cache:
+ directories:
+ - $HOME/Library/Caches/Homebrew
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
+- if [ -f "$(which ninja)" ]; then export CMAKE_ARGS="$CMAKE_ARGS -GNinja"; 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
+- alias _cmake_config='cmake $CMAKE_ARGS . -Bbuild'
+- alias _cmake_build='cmake --build build'
install:
- git clone https://gitlab.matrix.org/matrix-org/olm.git
- pushd olm
-- $_CMAKE_CONFIG
-- $_CMAKE_BUILD
-#- $_CMAKE_BUILD_INSTALL
+- _cmake_config
+- _cmake_build # TODO: add --target install when the patch lands in olm
- popd
- git clone https://github.com/quotient-im/matrix-doc.git
- git clone --recursive https://github.com/KitsuneRal/gtad.git
@@ -65,12 +60,12 @@ install:
- popd
before_script:
-- $_CMAKE_CONFIG -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" -DOlm_DIR=olm/build
-- $_CMAKE_BUILD --target update-api
+- _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_build --target install
+# Build qmc-example with the installed libQuotient
- cmake $CMAKE_ARGS examples -Bbuild-example -DOlm_DIR=olm/build
- cmake --build build-example --target all
# Build with qmake