px4-firmware/.travis.yml

152 lines
5.7 KiB
YAML

# Build and autotest script for PX4 Firmware
# http://travis-ci.org
language: cpp
matrix:
fast_finish: true
include:
- os: linux
sudo: false
env: GCC_VER=4.8
- os: linux
sudo: false
env: GCC_VER=4.9
- os: osx
osx_image: xcode7
sudo: true
cache:
directories:
- $HOME/.ccache
addons:
apt:
sources:
- kubuntu-backports
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
packages:
- build-essential
- ccache
- clang-3.5
- cmake
- g++-4.9
- gcc-4.9
- genromfs
- libc6-i386
- libncurses5-dev
- ninja-build
- python-argparse
- python-empy
- s3cmd
- texinfo
- zlib1g-dev
before_install:
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
pushd .
&& cd ~ && mkdir gcc && cd gcc
&& if [ "$GCC_VER" = "4.8" ]; then GCC_URL="https://launchpadlibrarian.net/186124160/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2" ; fi
&& if [ "$GCC_VER" = "4.9" ]; then GCC_URL="https://launchpad.net/gcc-arm-embedded/4.9/4.9-2014-q4-major/+download/gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2" ; fi
&& wget -O gcc.tar.bz2 ${GCC_URL}
&& tar -jxf gcc.tar.bz2 --strip 1
&& exportline="export PATH=$HOME/gcc/bin:\$PATH"
&& if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
&& . ~/.profile
&& popd
&& git clone git://github.com/PX4/CI-Tools.git
&& ./CI-Tools/s3cmd-configure
&& mkdir -p ~/bin
&& wget -O ~/bin/astyle https://github.com/PX4/astyle/releases/download/2.05.1/astyle-linux && chmod +x ~/bin/astyle
&& astyle --version
&& if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
;
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
brew tap PX4/homebrew-px4
&& brew update; brew update
&& brew install cmake ninja
&& brew install genromfs
&& sudo easy_install pip
&& sudo pip install empy
;
fi
before_script:
# setup ccache
- mkdir -p ~/bin
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-g++
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-gcc
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-size
- ln -s /usr/bin/ccache ~/bin/arm-none-eabi-objcopy
- ln -s /usr/bin/ccache ~/bin/clang++
- ln -s /usr/bin/ccache ~/bin/clang++-3.4
- ln -s /usr/bin/ccache ~/bin/clang++-3.5
- ln -s /usr/bin/ccache ~/bin/clang
- ln -s /usr/bin/ccache ~/bin/clang-3.4
- ln -s /usr/bin/ccache ~/bin/clang-3.5
- export PATH=~/bin:$PATH
env:
global:
- NINJA_BUILD=1
# AWS KEY: $PX4_AWS_KEY
- secure: "XknnZHWBbpHbN4f3fuAVwUztdLIu8ej4keC3aQSDofo3uw8AFEzojfsQsN9u77ShWSIV4iYJWh9C9ALkCx7TocJ+xYjiboo10YhM9lH/8u+EXjYWG6GHS8ua0wkir+cViSxoLNaMtmcb/rPTicJecAGANxLsIHyBAgTL3fkbLSA="
# AWS SECRET: $PX4_AWS_SECRET
- secure: "h6oajlW68dWIr+wZhO58Dv6e68dZHrBLVA6lPXZmheFQBW6Xam1HuLGA0LOW6cL9TnrAsOZ8g4goB58eMQnMEijFZKi3mhRwZhd/Xjq/ZGJOWBUrLoQHZUw2dQk5ja5vmUlKEoQnFZjDuMjx8KfX5ZMNy8A3yssWZtJYHD8c+bk="
- PX4_AWS_BUCKET=px4-travis
script:
- git submodule update --quiet --init --recursive
- echo 'Building POSIX Firmware..' && make posix_sitl_default
- echo 'Running Tests..' && make posix_sitl_default test
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
cd ${TRAVIS_BUILD_DIR}
&& make check_format
&& arm-none-eabi-gcc --version
&& echo 'Building NuttX px4fmu-v1 Firmware..' && make px4fmu-v1_default
&& echo 'Building NuttX px4fmu-v2 Firmware..' && make px4fmu-v2_default
&& echo 'Building UAVCAN node firmware..' && make uavcan_firmware
&& echo 'Building NuttX px4fmu-v4 Firmware..' && make px4fmu-v4_default
&& echo 'Building NuttX px4-stm32f4discovery Firmware..' && make px4-stm32f4discovery_default
&& echo 'Running Tests..' && make tests
;
fi
after_success:
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "${GCC_VER}" = "4.8" ]]; then
make package_firmware
&& cp build_px4fmu-v1_default/src/firmware/nuttx/nuttx-px4fmu-v1-default.px4 px4fmu-v1_default.px4
&& cp build_px4fmu-v2_default/src/firmware/nuttx/nuttx-px4fmu-v2-default.px4 px4fmu-v2_default.px4
&& cp build_px4fmu-v4_default/src/firmware/nuttx/nuttx-px4fmu-v4-default.px4 px4fmu-v4_default.px4
&& cp build_px4-stm32f4discovery_default/src/firmware/nuttx/nuttx-px4-stm32f4discovery-default.px4 px4-stm32f4discovery-default.px4
&& ./CI-Tools/s3cmd-put px4fmu-v1_default.px4 px4fmu-v2_default.px4 px4fmu-v4_default.px4 px4-stm32f4discovery-default.px4 build_px4fmu-v2_default/parameters.xml build_px4fmu-v2_default/airframes.xml CI-Tools/directory/index.html Firmware/$TRAVIS_BRANCH/
&& ./CI-Tools/s3cmd-put Firmware.zip archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/
&& ./CI-Tools/s3cmd-put CI-Tools/directory/index.html archives/Firmware/$TRAVIS_BRANCH/
&& ./CI-Tools/s3cmd-put CI-Tools/index.html index.html
&& ./CI-Tools/s3cmd-put CI-Tools/timestamp.html timestamp.html
&& echo ""
&& echo "Binaries have been posted to:"
&& echo https://px4-travis.s3.amazonaws.com/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/Firmware.zip
;
fi
deploy:
provider: releases
api_key:
secure: cdHWLRBxA5UlYpOS0Sp891QK7PFmMgQ5ZWs1aPt+sw0rIrowyWMHCwXNBEdUqaExHYNYgXCUDI0EzNgfB7ZcR63Qv1MQeoyamV4jsxlyAqDqmxNtWO82S6RhHGeMLk26VgFKzynVcEk1IYlQP2nqzMQLdu+jTrngERuAIrCdRuc=
file: "Firmware.zip"
skip_cleanup: true
on:
tags: true
all_branches: true
repo: PX4/Firmware
condition: $GCC_VER = 4.8
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/2b9c4a4cb2211f8befba
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always