2014-12-20 13:54:35 -04:00
|
|
|
# Build and autotest script for PX4 Firmware
|
|
|
|
# http://travis-ci.org
|
|
|
|
|
|
|
|
language: cpp
|
|
|
|
|
2016-10-19 21:31:56 -03:00
|
|
|
git:
|
|
|
|
depth: 1000
|
|
|
|
|
2015-09-13 14:53:47 -03:00
|
|
|
matrix:
|
2015-10-18 11:10:33 -03:00
|
|
|
fast_finish: true
|
2015-09-13 14:53:47 -03:00
|
|
|
include:
|
|
|
|
- os: linux
|
2016-06-14 02:06:43 -03:00
|
|
|
sudo: required
|
2016-10-20 20:17:26 -03:00
|
|
|
env: GCC_VER=4.9 DOCKER_REPO="px4io/px4-dev-base:2016-10-20"
|
2016-06-14 02:06:43 -03:00
|
|
|
services:
|
|
|
|
- docker
|
2015-09-13 14:53:47 -03:00
|
|
|
- os: osx
|
2015-10-17 01:47:16 -03:00
|
|
|
sudo: true
|
2016-09-26 18:37:13 -03:00
|
|
|
osx_image: xcode8
|
2016-06-22 18:42:49 -03:00
|
|
|
env: CCACHE_CPP2=1
|
2015-04-17 23:12:44 -03:00
|
|
|
|
|
|
|
cache:
|
2016-06-22 18:42:49 -03:00
|
|
|
ccache: true
|
|
|
|
pip: true
|
2015-04-17 23:12:44 -03:00
|
|
|
directories:
|
2016-06-22 18:42:49 -03:00
|
|
|
- $HOME/.pip/cache/
|
|
|
|
- $HOME/Library/Caches/pip
|
2015-04-17 23:12:44 -03:00
|
|
|
|
2015-09-13 14:53:47 -03:00
|
|
|
before_install:
|
|
|
|
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
2016-06-23 12:04:36 -03:00
|
|
|
cd ${TRAVIS_BUILD_DIR}
|
|
|
|
&& git fetch --unshallow && git fetch --all --tags
|
2016-06-22 18:42:49 -03:00
|
|
|
&& docker pull ${DOCKER_REPO}
|
|
|
|
;
|
2015-09-13 14:53:47 -03:00
|
|
|
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
2016-06-23 02:22:47 -03:00
|
|
|
sudo -H easy_install pip
|
2016-06-22 22:55:12 -03:00
|
|
|
&& sudo -H pip install empy
|
2016-06-23 02:22:47 -03:00
|
|
|
&& wget https://s3.amazonaws.com/px4-travis/toolchain/macos/ccache
|
|
|
|
&& sudo mv ccache /usr/local/bin
|
|
|
|
&& chmod +x /usr/local/bin/ccache
|
|
|
|
&& mkdir -p ~/bin
|
|
|
|
&& sudo ln -s /usr/local/bin/ccache ~/bin/c++
|
|
|
|
&& sudo ln -s /usr/local/bin/ccache ~/bin/cc
|
|
|
|
&& sudo ln -s /usr/local/bin/ccache ~/bin/clang
|
|
|
|
&& sudo ln -s /usr/local/bin/ccache ~/bin/clang++
|
|
|
|
&& sudo ln -s /usr/local/bin/ccache ~/bin/g++
|
|
|
|
&& sudo ln -s /usr/local/bin/ccache ~/bin/gcc
|
|
|
|
&& export PATH=~/bin:$PATH
|
|
|
|
&& wget https://s3.amazonaws.com/px4-travis/toolchain/macos/ninja
|
|
|
|
&& sudo mv ninja /usr/local/bin
|
|
|
|
&& chmod +x /usr/local/bin/ninja
|
2015-09-13 14:53:47 -03:00
|
|
|
;
|
|
|
|
fi
|
|
|
|
|
2014-12-21 12:01:26 -04:00
|
|
|
env:
|
|
|
|
global:
|
|
|
|
# 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
|
2016-06-23 02:22:47 -03:00
|
|
|
- GIT_SUBMODULES_ARE_EVIL=1
|
2014-12-21 12:01:26 -04:00
|
|
|
|
2014-12-20 13:54:35 -04:00
|
|
|
script:
|
2016-06-22 18:42:49 -03:00
|
|
|
- ccache -M 1GB; ccache -z
|
2016-02-17 23:39:48 -04:00
|
|
|
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
2016-10-12 04:27:02 -03:00
|
|
|
docker run --rm -v `pwd`:`pwd`:rw -v $HOME/.ccache:$HOME/.ccache:rw -e CCACHE_DIR=$HOME/.ccache -e CI=true -e GIT_SUBMODULES_ARE_EVIL=1 -w=`pwd` --user=$UID -it ${DOCKER_REPO} /bin/bash -c "make check_qgc_firmware VECTORCONTROL=0";
|
2016-04-17 18:18:26 -03:00
|
|
|
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
2016-08-26 04:54:49 -03:00
|
|
|
make tests;
|
2016-02-17 23:39:48 -04:00
|
|
|
fi
|
2016-06-22 18:42:49 -03:00
|
|
|
- ccache -s
|
2015-09-10 03:21:40 -03:00
|
|
|
|
2015-10-17 11:33:18 -03:00
|
|
|
after_success:
|
2016-08-26 04:54:49 -03:00
|
|
|
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
2016-09-29 01:10:29 -03:00
|
|
|
make package_firmware && mkdir s3deploy-archive && cp Firmware.zip s3deploy-archive/
|
2016-12-12 20:43:18 -04:00
|
|
|
&& cp Binaries/* .
|
2016-09-29 01:10:29 -03:00
|
|
|
&& find . -maxdepth 1 -mindepth 1 -type f -name 'nuttx-*-default.px4' | sed 's/.\/nuttx-//' | sed 's/-default.px4//' | xargs -I{} mv nuttx-{}-default.px4 {}_default.px4
|
2016-12-12 20:43:18 -04:00
|
|
|
&& mkdir s3deploy-branch && mv *_default.px4 Meta/px4fmu-v2_default/parameters.xml Meta/px4fmu-v2_default/airframes.xml s3deploy-branch/;
|
2016-09-29 01:10:29 -03:00
|
|
|
fi
|
2016-10-20 20:17:26 -03:00
|
|
|
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "$GCC_VER" == "4.9" ]]; then
|
2016-09-29 01:10:29 -03:00
|
|
|
export PX4_S3_DEPLOY=1;
|
2016-06-14 02:56:42 -03:00
|
|
|
fi
|
2014-12-21 12:01:26 -04:00
|
|
|
|
2014-12-20 19:50:06 -04:00
|
|
|
deploy:
|
2016-06-14 02:06:43 -03:00
|
|
|
# deploy *.px4 to S3 px4-travis/Firmware/$TRAVIS_BRANCH
|
|
|
|
- provider: s3
|
|
|
|
access_key_id: $PX4_AWS_KEY
|
|
|
|
secret_access_key:
|
|
|
|
secure: $PX4_AWS_SECRET
|
|
|
|
bucket: px4-travis
|
|
|
|
local_dir: s3deploy-branch
|
|
|
|
upload-dir: Firmware/$TRAVIS_BRANCH
|
|
|
|
acl: public_read
|
|
|
|
skip_cleanup: true
|
|
|
|
on:
|
2016-06-14 02:56:42 -03:00
|
|
|
all_branches: true
|
|
|
|
condition: $PX4_S3_DEPLOY = 1
|
2016-06-14 02:06:43 -03:00
|
|
|
|
|
|
|
# deploy Firmware.zip to S3 px4-travis/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID
|
|
|
|
- provider: s3
|
|
|
|
access_key_id: $PX4_AWS_KEY
|
|
|
|
secret_access_key:
|
|
|
|
secure: $PX4_AWS_SECRET
|
|
|
|
bucket: px4-travis
|
|
|
|
local_dir: s3deploy-archive
|
|
|
|
upload-dir: archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID
|
|
|
|
acl: public_read
|
|
|
|
skip_cleanup: true
|
|
|
|
on:
|
2016-06-14 02:56:42 -03:00
|
|
|
all_branches: true
|
|
|
|
condition: $PX4_S3_DEPLOY = 1
|
2016-06-14 02:06:43 -03:00
|
|
|
|
|
|
|
# on tags deploy Firmware.zip to Github releases
|
|
|
|
- provider: releases
|
|
|
|
api_key:
|
|
|
|
secure: cdHWLRBxA5UlYpOS0Sp891QK7PFmMgQ5ZWs1aPt+sw0rIrowyWMHCwXNBEdUqaExHYNYgXCUDI0EzNgfB7ZcR63Qv1MQeoyamV4jsxlyAqDqmxNtWO82S6RhHGeMLk26VgFKzynVcEk1IYlQP2nqzMQLdu+jTrngERuAIrCdRuc=
|
|
|
|
file: "Firmware.zip"
|
|
|
|
skip_cleanup: true
|
|
|
|
on:
|
|
|
|
tags: true
|
|
|
|
all_branches: true
|
|
|
|
repo: PX4/Firmware
|
2016-10-20 20:17:26 -03:00
|
|
|
condition: $GCC_VER = 4.9
|
2014-12-21 07:09:47 -04:00
|
|
|
|
2014-12-24 04:44:52 -04:00
|
|
|
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
|
2016-03-30 15:47:25 -03:00
|
|
|
slack:
|
2016-08-26 04:54:49 -03:00
|
|
|
rooms:
|
|
|
|
- secure: "QKw73Zel/s3JAbe/7XyO9tPnJwiiGFpYzSjdR8lG3tYFjRdXZnhxG4c+G7bkgkaPTS4Hult33VXE3kcEqOI7+C+eRwRlZhDfL0knQbXVCxjcLjzmUFdoPOwurlgZDw66PFWCi5tZcLKSRo3u4U8ibT4WKi3jm9sDSyOcfBAucMU="
|
2016-08-26 07:09:07 -03:00
|
|
|
on_pull_requests: false
|
|
|
|
on_success: never # options: [always|never|change] default: always
|
2016-09-06 18:34:02 -03:00
|
|
|
on_failure: never # options: [always|never|change] default: always
|