.travis.yml 4.57 KB
Newer Older
Daniel Agar's avatar
Daniel Agar committed
1 2 3
language: cpp

git:
4
  depth: 500
Daniel Agar's avatar
Daniel Agar committed
5

Daniel Agar's avatar
Daniel Agar committed
6 7 8 9 10
env:
  global:
    # ANDROID_STOREPASS
    secure: RGovyUnMw3fp/bHZi058JvANT1rYmNqrsuSYew0cIgirO6YbMHr/rsjwCm1FTYpBl8s1zgr+u2b8ftYnfnCz2YT+Aip4NWrVYpVU0FEmfytGILrnUS0pjlt8m7fU9AKR1ElOSll7yw7e1kftynN39Q321etvwbLZcXon6zz0suE=

11 12 13
matrix:
    include:
        - os: linux
14
          env: SPEC=linux-g++-64 CONFIG=debug
Daniel Agar's avatar
Daniel Agar committed
15
          sudo: true
16
        - os: linux
Daniel Agar's avatar
Daniel Agar committed
17
          env: SPEC=linux-g++-64 CONFIG=installer
Daniel Agar's avatar
Daniel Agar committed
18
          sudo: true
19 20
        - os: osx
          osx_image: beta-xcode6.3
21
          env: SPEC=macx-clang CONFIG=debug
22 23
        - os: osx
          osx_image: beta-xcode6.3
Daniel Agar's avatar
Daniel Agar committed
24
          env: SPEC=macx-clang CONFIG=installer
Daniel Agar's avatar
Daniel Agar committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38
        - os: android
          language: android
          env: SPEC=android-g++ CONFIG=debug
          sudo: false
        - os: android
          language: android
          env: SPEC=android-g++ CONFIG=release
          sudo: false

android:
  components:
    - platform-tools
    - build-tools-21.1.1
    - android-21
Daniel Agar's avatar
Daniel Agar committed
39 40

cache:
41
  - apt
Daniel Agar's avatar
Daniel Agar committed
42 43

before_install:
44
  - cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --tags
45 46
  - 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
47 48

install:
Daniel Agar's avatar
Daniel Agar committed
49
  - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
50
         sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
51
      && sudo apt-add-repository -y ppa:beineri/opt-qt542
Daniel Agar's avatar
Daniel Agar committed
52 53 54 55
      && 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
      && export CXX="g++-4.8"
      && export CC="gcc-4.8"
56
      && export DISPLAY=:99.0
Daniel Agar's avatar
Daniel Agar committed
57
      && export PATH=/opt/qt54/bin:$PATH
58
      && sh -e /etc/init.d/xvfb start
Daniel Agar's avatar
Daniel Agar committed
59
      ;
60
    elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
61 62 63 64 65
         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
66
      ;
Daniel Agar's avatar
Daniel Agar committed
67 68 69 70 71 72 73 74 75 76 77
    elif [ "${TRAVIS_OS_NAME}" = "android" ]; then
         wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin
      && chmod +x android-ndk-r10e-linux-x86_64.bin
      && ./android-ndk-r10e-linux-x86_64.bin > /dev/null
      && export PATH=`pwd`/android-ndk-r10e:$PATH
      && export ANDROID_NDK_ROOT=`pwd`/android-ndk-r10e
      && export ANDROID_SDK_ROOT=/usr/local/android-sdk
      && wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.0-android.tar.bz2
      && tar jxf Qt5.5.0-android.tar.bz2
      && export PATH=`pwd`/Qt5.5.0/5.5/android_armv7/bin:$PATH
      ;
Daniel Agar's avatar
Daniel Agar committed
78 79
    fi

80

81
before_script: qmake -r qgroundcontrol.pro CONFIG+=${CONFIG} CONFIG+=WarningsAsErrorsOn -spec ${SPEC}
Daniel Agar's avatar
Daniel Agar committed
82
script:
83
  - echo 'Building QGroundControl' && echo -en 'travis_fold:start:script.1\\r'
Daniel Agar's avatar
Daniel Agar committed
84
  - make -j4
85 86
  - echo -en 'travis_fold:end:script.1\\r'
  - echo 'Running unittests' && echo -en 'travis_fold:start:script.2\\r'
87
  - if [[ "${TRAVIS_OS_NAME}" = "linux" && "${CONFIG}" = "debug" ]]; then ./debug/qgroundcontrol --unittest; fi
88 89
  - 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
90 91
  - if [ "${TRAVIS_OS_NAME}" = "android" ]; then make install INSTALL_ROOT=./release/android-build/ && androiddeployqt --input android-libqgroundcontrol.so-deployment-settings.json --output release/android-build --deployment bundled --gradle; fi
  - if [[ "${TRAVIS_OS_NAME}" = "android" && "${CONFIG}" = "release" && "${TRAVIS_SECURE_ENV_VARS}" = "true" ]]; then androiddeployqt --input android-libqgroundcontrol.so-deployment-settings.json --output release/android-build --deployment bundled --gradle --sign android/android_release.keystore dagar --storepass ${ANDROID_STOREPASS}; fi
Daniel Agar's avatar
Daniel Agar committed
92

Daniel Agar's avatar
Daniel Agar committed
93 94 95 96 97 98 99 100 101
deploy:
  provider: releases
  api-key:
    secure: ""
  file: "release/qgroundcontrol.dmg"
  skip_cleanup: true
  on:
    tags: true
    all_branches: true
102 103 104 105 106 107 108 109 110

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