.travis.yml 5.92 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
matrix:
12
    fast_finish: true
13 14
    include:
        - os: linux
15
          env: SPEC=linux-g++-64 CONFIG=debug
16
          sudo: false
17
        - os: linux
Daniel Agar's avatar
Daniel Agar committed
18
          env: SPEC=linux-g++-64 CONFIG=installer
19
          sudo: false
20 21
        - os: linux
          env: CONFIG=doxygen
Daniel Agar's avatar
Daniel Agar committed
22
          sudo: false
23
        - os: osx
Don Gagne's avatar
Don Gagne committed
24
          osx_image: xcode7
25
          env: SPEC=macx-clang CONFIG=debug
26
        - os: osx
Don Gagne's avatar
Don Gagne committed
27
          osx_image: xcode7
Daniel Agar's avatar
Daniel Agar committed
28
          env: SPEC=macx-clang CONFIG=installer
29 30 31 32
#        - os: android
#          language: android
#          env: SPEC=android-g++ CONFIG=debug
#          sudo: false
Daniel Agar's avatar
Daniel Agar committed
33 34
        - os: android
          language: android
35
          env: SPEC=android-g++ CONFIG=installer
Daniel Agar's avatar
Daniel Agar committed
36 37 38 39 40 41 42
          sudo: false

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

44 45 46 47 48 49
addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - ccache
50
    - doxygen
51 52 53
    - espeak
    - g++-4.8
    - gcc-4.8
54
    - graphviz
55 56 57 58 59
    - libc6-i386
    - libespeak-dev
    - libopenscenegraph-dev
    - libsdl1.2-dev
    - libudev-dev
60
    - texlive-font-utils
61

Daniel Agar's avatar
Daniel Agar committed
62
cache:
63 64 65
  directories:
    - $HOME/.ccache

Daniel Agar's avatar
Daniel Agar committed
66 67

before_install:
68
  - cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --tags
69 70
  - 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
71
  - 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
72 73

install:
74
  - if [[ "${TRAVIS_OS_NAME}" = "linux" && "${CONFIG}" != "doxygen" ]]; then
75
         wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-linux.tar.bz2
76 77
      && tar jxf Qt5.5.1-linux.tar.bz2 -C /tmp
      && export PATH=/tmp/Qt/5.5/gcc_64/bin:$PATH
Daniel Agar's avatar
Daniel Agar committed
78 79
      && export CXX="g++-4.8"
      && export CC="gcc-4.8"
80 81
      && export DISPLAY=:99.0
      && sh -e /etc/init.d/xvfb start
Daniel Agar's avatar
Daniel Agar committed
82
      ;
83
    elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
84 85 86
         brew update
      && brew install qt5
      && export PATH=/usr/local/opt/qt5/bin:$PATH
Daniel Agar's avatar
Daniel Agar committed
87
      ;
Daniel Agar's avatar
Daniel Agar committed
88 89 90 91 92 93 94
    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
95 96 97
      && 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
98
      ;
Daniel Agar's avatar
Daniel Agar committed
99 100
    fi

101

102
before_script:
103 104 105 106 107 108 109
# 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
110
  - if [[ "${TRAVIS_OS_NAME}" = "android" && "${CONFIG}" = "installer" && -z ${ANDROID_STOREPASS} ]]; then export CONFIG=release; fi
111
  - if [ "${CONFIG}" != "doxygen" ]; then qmake -r qgroundcontrol.pro CONFIG+=${CONFIG} CONFIG+=WarningsAsErrorsOn -spec ${SPEC}; fi
112

Daniel Agar's avatar
Daniel Agar committed
113
script:
114
  - echo 'Building QGroundControl' && echo -en 'travis_fold:start:script.1\\r'
115 116
  - if [ "${CONFIG}" != "doxygen" ]; then make -j4; fi
  - if [ "${CONFIG}" = "doxygen" ]; then cd src && doxygen documentation.dox; fi
117
  - echo -en 'travis_fold:end:script.1\\r'
118
  - if [[ "${TRAVIS_OS_NAME}" = "linux" && "${CONFIG}" = "debug" ]]; then ./debug/qgroundcontrol --unittest; fi
119
  - if [[ "${TRAVIS_OS_NAME}" = "osx" && "${CONFIG}" = "debug" ]]; then ./debug/qgroundcontrol.app/Contents/MacOS/qgroundcontrol --unittest; fi
Daniel Agar's avatar
Daniel Agar committed
120

Daniel Agar's avatar
Daniel Agar committed
121
deploy:
Daniel Agar's avatar
Daniel Agar committed
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
  - provider: s3
    access_key_id: AKIAIVORNALE7NHD3T6Q
    secret_access_key:
      secure: BsLXeXUPsCJdX4tawrDnO8OFK5Hk4kzlDTiyH93En6TbjUargVAWDMcHVj7TUhr7+3Tao1W1zb0G4SJe9kHv+jrky0yE72KvoG3YAON0VXWKizxBAKkgHE2RxSTNAwDeKbi2G6YJfNDescBBfX7zEohShdXglQu7CGaUQKRaiI4=
    bucket: qgroundcontrol
    local_dir: release/package
    upload-dir: ${TRAVIS_BRANCH}
    acl: public_read
    skip_cleanup: true
    on:
      all_branches: true
      condition: $CONFIG = installer
  - provider: releases
    api-key:
      secure: K/Zqr/FCC7QvzFxYvBtCinPkacQq2ubJ2qm982+38Zf/KjibVOF1dEbVdrGZmII6Tg5DaQzNXGYkg5PvYmJgT9xRsqeQjeYIUYqYZpAt+HYWA38AVfMU8jip/1P1wmwqD469nzJOBBa8yfsMs6Ca7tBaNl/zTxCRGnAgEzqtkdQ=
    file:
      - release/package/qgroundcontrol.apk
      - release/package/qgroundcontrol.dmg
      - release/package/qgroundcontrol.tar.bz2
    skip_cleanup: true
    on:
      tags: true
      condition: $CONFIG = installer
145 146 147 148 149
  - provider: s3
    access_key_id: AKIAIVORNALE7NHD3T6Q
    secret_access_key:
      secure: BsLXeXUPsCJdX4tawrDnO8OFK5Hk4kzlDTiyH93En6TbjUargVAWDMcHVj7TUhr7+3Tao1W1zb0G4SJe9kHv+jrky0yE72KvoG3YAON0VXWKizxBAKkgHE2RxSTNAwDeKbi2G6YJfNDescBBfX7zEohShdXglQu7CGaUQKRaiI4=
    bucket: qgroundcontrol
150
    local_dir: ${TRAVIS_BUILD_DIR}/src/html
151 152
    upload-dir: doxygen
    acl: public_read
153
    skip_cleanup: true
154 155 156
    branch: master
    on:
      condition: $CONFIG = doxygen
157 158 159 160 161 162 163 164 165

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