aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 7a9a6599d8c1041f00becd60b3a425cb7ce91945 (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
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

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 USE_NINJA="-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
- 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 --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

script:
- cmake --build build --target all
- cmake --build build --target 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
# Build with qmake
- qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += 3rdparty/libQtOlm/olm/include" "LIBS += -Lbuild/lib"
- 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

notifications:
  webhooks:
    urls:
    - "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MGtpdHN1bmUlM0FtYXRyaXgub3JnLyUyMVBDelV0eHRPalV5U3hTZWxvZiUzQW1hdHJpeC5vcmc"
    on_success: change  # always|never|change
    on_failure: always
    on_start: never