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

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

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

12
matrix:
13
    fast_finish: true
14 15
    include:
        - os: linux
16
          env: SPEC=linux-g++-64 CONFIG=debug QT_FATAL_WARNINGS=1
Daniel Agar's avatar
Daniel Agar committed
17 18
          sudo: required
          dist: trusty
19
        - os: linux
20
          env: SPEC=linux-g++-64 CONFIG=installer
Daniel Agar's avatar
Daniel Agar committed
21 22
          sudo: required 
          dist: trusty
23
        - os: osx
Don Gagne's avatar
Don Gagne committed
24
          osx_image: xcode7
25
          env: SPEC=macx-clang CONFIG=debug QT_FATAL_WARNINGS=1
Don Gagne's avatar
Don Gagne committed
26
          sudo: required
27
        - os: osx
Don Gagne's avatar
Don Gagne committed
28
          osx_image: xcode7
29
          env: SPEC=macx-clang CONFIG=installer
Don Gagne's avatar
Don Gagne committed
30
          sudo: required
Don Gagne's avatar
Don Gagne committed
31 32
        - os: osx
          osx_image: xcode7
33
          env: SPEC=ios
Daniel Agar's avatar
Daniel Agar committed
34 35
        - os: android
          language: android
36
          env: SPEC=android-g++ CONFIG=installer
Daniel Agar's avatar
Daniel Agar committed
37
          sudo: false
38 39
        - os: linux
          env: CONFIG=doxygen
40 41
          sudo: required
          dist: trusty
Daniel Agar's avatar
Daniel Agar committed
42 43 44 45 46 47

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

49 50 51 52 53 54
addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - ccache
Daniel Agar's avatar
Daniel Agar committed
55 56
    - debhelper
    - devscripts
57
    - doxygen
Daniel Agar's avatar
Daniel Agar committed
58
    - dput
59 60 61
    - espeak
    - g++-4.8
    - gcc-4.8
62
    - graphviz
63 64
    - libc6-i386
    - libespeak-dev
65 66 67
    - libgstreamer-plugins-base1.0-dev
    - libgstreamer1.0-0:amd64
    - libgstreamer1.0-dev
68 69 70
    - libopenscenegraph-dev
    - libsdl1.2-dev
    - libudev-dev
71
    - texlive-font-utils
72
    - wget
73

Daniel Agar's avatar
Daniel Agar committed
74
cache:
75 76 77
  directories:
    - $HOME/.ccache

Daniel Agar's avatar
Daniel Agar committed
78 79

before_install:
80
  - if [[ "${TRAVIS_PULL_REQUEST}" = "false" && "${CONFIG}" = "debug" ]]; then exit 0; fi
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
  - cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow
  - git fetch --all --tags
  - 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
  - if [ "${TRAVIS_OS_NAME}" = "android" ]; then
        wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-android-armv7-1.5.2.tar.bz2 &&
        mkdir -p ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2 &&
        tar jxf gstreamer-1.0-android-armv7-1.5.2.tar.bz2 -C ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2
        ;
    fi
Daniel Agar's avatar
Daniel Agar committed
99 100

install:
101
  - if [[ "${TRAVIS_OS_NAME}" = "linux" && "${CONFIG}" != "doxygen" ]]; then
102 103 104 105 106 107 108 109 110 111
        wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-linux.tar.bz2 &&
        tar jxf Qt5.5.1-linux.tar.bz2 -C /tmp &&
        export PATH=/tmp/Qt/5.5/gcc_64/bin:$PATH &&
        export CXX="g++-4.8" &&
        export CC="gcc-4.8" &&
        export DISPLAY=:99.0 &&
        sh -e /etc/init.d/xvfb start
        ;
    fi
  - if [[ "${TRAVIS_OS_NAME}" = "osx" && "${SPEC}" != "ios" ]]; then
112 113
        wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-devel-1.5.2-x86_64.pkg &&
        wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-1.5.2-x86_64.pkg &&
Don Gagne's avatar
Don Gagne committed
114 115
        sudo installer -verboseR -pkg gstreamer-1.0-devel-1.5.2-x86_64.pkg -target / &&
        sudo installer -verboseR -pkg gstreamer-1.0-1.5.2-x86_64.pkg -target / &&
116 117
        wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-mac-clang.tar.bz2 &&
        tar jxf Qt5.5.1-mac-clang.tar.bz2 -C /tmp &&
Don Gagne's avatar
Don Gagne committed
118
        wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/osx-gstreamer.tar.bz2 &&
Don Gagne's avatar
Don Gagne committed
119
        sudo tar jxf osx-gstreamer.tar.bz2 -C /Library/Frameworks &&
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
        export QT_DIR=Qt5.5-mac-clang/5.5/clang_64 &&
        export PATH=/tmp/$QT_DIR/bin:$PATH &&
        export QT_QPA_PLATFORM_PLUGIN_PATH=/tmp/$QT_DIR/plugins &&
        export QML2_IMPORT_PATH=/tmp/$QT_DIR/qml
        ;
    fi
  - if [[ "${TRAVIS_OS_NAME}" = "osx" && "${SPEC}" = "ios" ]]; then
        wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-ios.tar.bz2 &&
        tar jxf Qt5.5.1-ios.tar.bz2 -C /tmp &&
        export PATH=/tmp/ios/bin:$PATH
        ;
    fi
  - if [ "${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.1-linux.tar.bz2 &&
        tar jxf Qt5.5.1-linux.tar.bz2 -C /tmp &&
        export PATH=/tmp/Qt/5.5/android_armv7/bin:$PATH
        ;
Daniel Agar's avatar
Daniel Agar committed
143 144
    fi

145

146
before_script:
147 148 149 150 151 152 153
# setup ccache
  - mkdir -p ~/bin
  - ln -s /usr/bin/ccache ~/bin/g++
  - ln -s /usr/bin/ccache ~/bin/g++-4.8
  - ln -s /usr/bin/ccache ~/bin/gcc
  - ln -s /usr/bin/ccache ~/bin/gcc-4.8
  - export PATH=~/bin:$PATH
154 155
  - wget http://px4-travis.s3.amazonaws.com/Firmware/master/parameters.xml -O src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml
  - wget http://px4-travis.s3.amazonaws.com/Firmware/master/airframes.xml -O src/AutoPilotPlugins/PX4/AirframeFactMetaData.xml
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
  - if [[ "${TRAVIS_OS_NAME}" = "android" && "${CONFIG}" = "installer" && -z ${ANDROID_STOREPASS} ]]; then
        export CONFIG=release
        ;
    fi
  - if [[ "${CONFIG}" != "doxygen" && "${SPEC}" != "ios" ]]; then
        mkdir ${SHADOW_BUILD_DIR} &&
        cd ${SHADOW_BUILD_DIR} &&
        qmake -r ${TRAVIS_BUILD_DIR}/qgroundcontrol.pro CONFIG+=${CONFIG} CONFIG+=WarningsAsErrorsOn -spec ${SPEC}
        ;
        fi
  - if [ "${SPEC}" = "ios" ]; then
        mkdir ${SHADOW_BUILD_DIR} &&
        cd ${SHADOW_BUILD_DIR} &&
        qmake -r ${TRAVIS_BUILD_DIR}/qgroundcontrol.pro CONFIG+=WarningsAsErrorsOn CONFIG-=debug_and_release CONFIG+=release
        ;
    fi
172

Daniel Agar's avatar
Daniel Agar committed
173
script:
174 175 176 177 178 179 180
  - if [ "${TRAVIS_OS_NAME}" = "android" ]; then
        cd ${TRAVIS_BUILD_DIR} &&
        ./tools/update_android_version.sh
        ;
    fi
  - if [[ "${CONFIG}" != "doxygen" && "${SPEC}" != "ios" ]]; then
        cd ${SHADOW_BUILD_DIR} &&
Daniel Agar's avatar
Daniel Agar committed
181
        make -j4 | sed 's/${TRAVIS_BUILD_DIR}/-/'
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
        ;
    fi
  - if [ "${SPEC}" = "ios" ]; then
        cd ${SHADOW_BUILD_DIR} &&
        xcodebuild -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
        ;
    fi
  - if [ "${CONFIG}" = "doxygen" ]; then
        cd ${TRAVIS_BUILD_DIR}/src &&
        doxygen documentation.dox
        ;
    fi
  - if [[ "${TRAVIS_OS_NAME}" = "linux" && "${CONFIG}" = "debug" ]]; then
        ${SHADOW_BUILD_DIR}/debug/qgroundcontrol --unittest
        ;
        fi
  - if [[ "${TRAVIS_OS_NAME}" = "osx" && "${CONFIG}" = "debug" ]]; then
        ${SHADOW_BUILD_DIR}/debug/qgroundcontrol.app/Contents/MacOS/qgroundcontrol --unittest
        ;
    fi
Daniel Agar's avatar
Daniel Agar committed
202

203
after_success:
204
  - if [[ "${TRAVIS_OS_NAME}" = "linux" && "${CONFIG}" = "installer" ]]; then
205
        ${TRAVIS_BUILD_DIR}/deploy/create_linux_appimage.sh ${TRAVIS_BUILD_DIR} ${SHADOW_BUILD_DIR}/release ${SHADOW_BUILD_DIR}/release/package;
206
    fi
207 208
  - if [ "${TRAVIS_TAG}" ]; then
        export GOOGLE_PLAY_TRACK=production;
209
    elif [ "${TRAVIS_BRANCH}" = "master" ]; then
210
        export GOOGLE_PLAY_TRACK=beta;
211 212
    else
        export GOOGLE_PLAY_TRACK=none;
213
    fi
214
  - if [[ "${TRAVIS_OS_NAME}" = "android" && "${TRAVIS_PULL_REQUEST}" = "false" && "${GOOGLE_PLAY_TRACK}" != "none" ]]; then
215 216 217 218 219
        pip install --user google-api-python-client PyOpenSSL &&
        cd ${TRAVIS_BUILD_DIR} &&
        openssl aes-256-cbc -K $encrypted_25db6eb7c3fd_key -iv $encrypted_25db6eb7c3fd_iv -in ${TRAVIS_BUILD_DIR}/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc -out android/Google_Play_Android_Developer-4432a3c4f5d1.json -d &&
        ${TRAVIS_BUILD_DIR}/tools/google_play_upload.py ${GOOGLE_PLAY_TRACK} org.mavlink.qgroundcontrol ${SHADOW_BUILD_DIR}/release/package/qgroundcontrol.apk
        ;
220
    fi
221

222 223 224
before_deploy:
  - rvm 1.9.3 do gem install mime-types -v 2.6.2

Daniel Agar's avatar
Daniel Agar committed
225
deploy:
Daniel Agar's avatar
Daniel Agar committed
226 227 228 229 230
  - provider: s3
    access_key_id: AKIAIVORNALE7NHD3T6Q
    secret_access_key:
      secure: BsLXeXUPsCJdX4tawrDnO8OFK5Hk4kzlDTiyH93En6TbjUargVAWDMcHVj7TUhr7+3Tao1W1zb0G4SJe9kHv+jrky0yE72KvoG3YAON0VXWKizxBAKkgHE2RxSTNAwDeKbi2G6YJfNDescBBfX7zEohShdXglQu7CGaUQKRaiI4=
    bucket: qgroundcontrol
dogmaphobic's avatar
dogmaphobic committed
231
    local_dir: ${SHADOW_BUILD_DIR}/release/package
232
    upload-dir: builds/${TRAVIS_BRANCH}
Daniel Agar's avatar
Daniel Agar committed
233
    acl: public_read
234
    region: us-west-2
Daniel Agar's avatar
Daniel Agar committed
235 236 237 238 239 240 241
    skip_cleanup: true
    on:
      all_branches: true
      condition: $CONFIG = installer
  - provider: releases
    api-key:
      secure: K/Zqr/FCC7QvzFxYvBtCinPkacQq2ubJ2qm982+38Zf/KjibVOF1dEbVdrGZmII6Tg5DaQzNXGYkg5PvYmJgT9xRsqeQjeYIUYqYZpAt+HYWA38AVfMU8jip/1P1wmwqD469nzJOBBa8yfsMs6Ca7tBaNl/zTxCRGnAgEzqtkdQ=
242
    file_glob: true
Daniel Agar's avatar
Daniel Agar committed
243
    file:
244
      - ${SHADOW_BUILD_DIR}/release/package/qgroundcontrol.*
245
      - ${SHADOW_BUILD_DIR}/release/package/QGroundControl.*
Daniel Agar's avatar
Daniel Agar committed
246 247 248 249
    skip_cleanup: true
    on:
      tags: true
      condition: $CONFIG = installer
250 251 252 253 254
  - provider: s3
    access_key_id: AKIAIVORNALE7NHD3T6Q
    secret_access_key:
      secure: BsLXeXUPsCJdX4tawrDnO8OFK5Hk4kzlDTiyH93En6TbjUargVAWDMcHVj7TUhr7+3Tao1W1zb0G4SJe9kHv+jrky0yE72KvoG3YAON0VXWKizxBAKkgHE2RxSTNAwDeKbi2G6YJfNDescBBfX7zEohShdXglQu7CGaUQKRaiI4=
    bucket: qgroundcontrol
255
    local_dir: ${TRAVIS_BUILD_DIR}/src/html
256 257
    upload-dir: doxygen
    acl: public_read
258
    region: us-west-2
259
    skip_cleanup: true
260 261
    branch: master
    on:
262
      tags: true
263
      condition: $CONFIG = doxygen
264 265 266 267 268 269 270 271 272

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