.travis.yml 2.87 KB
Newer Older
1 2
sudo: true

Daniel Agar's avatar
Daniel Agar committed
3 4 5
language: cpp

git:
6
  depth: 500
Daniel Agar's avatar
Daniel Agar committed
7

8 9 10
matrix:
    include:
        - os: linux
11
          env: SPEC=linux-g++-64 CONFIG=debug
12
        - os: linux
Daniel Agar's avatar
Daniel Agar committed
13
          env: SPEC=linux-g++-64 CONFIG=installer
14 15
        - os: osx
          osx_image: beta-xcode6.3
16
          env: SPEC=macx-clang CONFIG=debug
17 18
        - os: osx
          osx_image: beta-xcode6.3
Daniel Agar's avatar
Daniel Agar committed
19
          env: SPEC=macx-clang CONFIG=installer
Daniel Agar's avatar
Daniel Agar committed
20 21

cache:
22
  - apt
Daniel Agar's avatar
Daniel Agar committed
23 24

before_install:
25
  - cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --tags
26 27
  - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then mkdir -p ~/.config/QtProject/ && cp ${TRAVIS_BUILD_DIR}/test/qtlogging.ini ~/.config/QtProject/; fi
  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then mkdir -p ~/Library/Preferences/QtProject/ && cp ${TRAVIS_BUILD_DIR}/test/qtlogging.ini ~/Library/Preferences/QtProject/; fi
Daniel Agar's avatar
Daniel Agar committed
28 29

install:
30
  - if [[ "${TRAVIS_OS_NAME}" = "linux" || "${TRAVIS_OS_NAME}" = "android" ]]; then
31
         sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
32
      && sudo apt-add-repository -y ppa:beineri/opt-qt542
Daniel Agar's avatar
Daniel Agar committed
33 34
      && sudo apt-get -qq update
      && sudo apt-get -qq install g++-4.8 libc6-i386 qt54tools qt54base qt54declarative qt54serialport qt54svg qt54webkit qt54quickcontrols qt54xmlpatterns qt54x11extras qt54websockets qt54sensors qt54script qt54quick1 qt54multimedia qt54location qt54imageformats qt54graphicaleffects qt54connectivity espeak libespeak-dev libopenscenegraph-dev libsdl1.2-dev libudev-dev
35
      && export PATH=/opt/qt54/bin:$PATH
Daniel Agar's avatar
Daniel Agar committed
36 37
      && export CXX="g++-4.8"
      && export CC="gcc-4.8"
38 39
      && export DISPLAY=:99.0
      && sh -e /etc/init.d/xvfb start
Daniel Agar's avatar
Daniel Agar committed
40
      ;
41
    elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
42 43 44 45 46
         brew tap PX4/homebrew-px4
      && brew update
      && brew install qt54
      && brew linkapps qt54
      && export PATH=/usr/local/opt/qt54/bin:$PATH
Daniel Agar's avatar
Daniel Agar committed
47 48 49
      ;
    fi

50

51
before_script: qmake -r qgroundcontrol.pro CONFIG+=${CONFIG} CONFIG+=WarningsAsErrorsOn -spec ${SPEC}
Daniel Agar's avatar
Daniel Agar committed
52
script:
53
  - echo 'Building QGroundControl' && echo -en 'travis_fold:start:script.1\\r'
Daniel Agar's avatar
Daniel Agar committed
54
  - make -j4
55 56
  - echo -en 'travis_fold:end:script.1\\r'
  - echo 'Running unittests' && echo -en 'travis_fold:start:script.2\\r'
57
  - if [[ "${TRAVIS_OS_NAME}" = "linux" && "${CONFIG}" = "debug" ]]; then ./debug/qgroundcontrol --unittest; fi
58 59
  - if [[ "${TRAVIS_OS_NAME}" = "osx" && "${CONFIG}" = "debug" ]]; then ./debug/qgroundcontrol.app/Contents/MacOS/qgroundcontrol --unittest; fi
  - echo -en 'travis_fold:end:script.2\\r'
Daniel Agar's avatar
Daniel Agar committed
60

Daniel Agar's avatar
Daniel Agar committed
61 62 63 64 65 66 67 68 69
deploy:
  provider: releases
  api-key:
    secure: ""
  file: "release/qgroundcontrol.dmg"
  skip_cleanup: true
  on:
    tags: true
    all_branches: true
70 71 72 73 74 75 76 77 78

notifications:
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/60b033428ae9dc715662
    on_success: change  # options: [always|never|change] default: always
    on_failure: always  # options: [always|never|change] default: always
    on_start: never     # options: [always|never|change] default: always