aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 3f2759bb59099dd9459073627c90abbd6434c967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
language: cpp
dist: bionic

git:
  depth: false

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="valgrind --tool=memcheck --leak-check=yes --gen-suppressions=all --suppressions=tests/.valgrind.supp $VALGRIND_OPTIONS"

matrix:
  include:
  - os: linux
    compiler: gcc
  - os: linux
    compiler: clang
  - os: osx
    osx_image: xcode10.1
    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:
- 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 # 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
- 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 --target install
# Build quotest with the installed libQuotient
- cmake $CMAKE_ARGS tests -Bbuild-test -DOlm_DIR=olm/build
- 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"
- make all
# Run the qmake-compiled quotest under valgrind
- if [ "$TEST_USER" != "" ]; then LD_LIBRARY_PATH="olm/build" $VALGRIND ./quotest "$QMC_TEST_USER" "$QMC_TEST_PWD" quotest-travis '#quotest: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