diff --git a/.travis.yml b/.travis.yml index f2da8bcf96..3272b1bfc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,15 @@ matrix: fast_finish: true include: - os: linux - sudo: false - env: GCC_VER=4.8 + sudo: required + env: GCC_VER=4.8 DOCKER_REPO="px4io/px4-dev-base" + services: + - docker - os: linux - sudo: false - env: GCC_VER=4.9 + sudo: required + env: GCC_VER=4.9 DOCKER_REPO="px4io/px4-dev-nuttx-gcc4.9" + services: + - docker - os: osx osx_image: xcode7 sudo: true @@ -20,49 +24,10 @@ 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: - - cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --all --tags + - cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --all --tags && git submodule update --quiet --init --recursive - 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 - ; + docker pull ${DOCKER_REPO}; elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew tap PX4/homebrew-px4 && brew update; brew update @@ -73,24 +38,8 @@ before_install: ; 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 @@ -98,39 +47,63 @@ env: - PX4_AWS_BUCKET=px4-travis script: - - git submodule update --quiet --init --recursive - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then - arm-none-eabi-gcc --version && make check VECTORCONTROL=1; + docker run --rm -v `pwd`:`pwd`:rw -v $HOME/.ccache:$HOME/.ccache:rw -e CCACHE_DIR=$HOME/.ccache -w=`pwd` --user=$UID -it ${DOCKER_REPO} /bin/bash -c "ccache -z; make check VECTORCONTROL=1; ccache -s"; elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then make check_posix_sitl_default; fi after_success: - - if [[ "${TRAVIS_OS_NAME}" = "linux" && "${GCC_VER}" = "4.8" ]]; then - make package_firmware - && find . -name \*.px4 -exec cp "{}" . \; - && 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 - && ./CI-Tools/s3cmd-put `find . -maxdepth 1 -mindepth 1 -type f -name '*_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:" https://px4-travis.s3.amazonaws.com/archives/Firmware/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID/Firmware.zip - ; - fi + - make package_firmware && mkdir s3deploy-archive && cp Firmware.zip s3deploy-archive/ +# find all px4 firmware (*.px4) and rename + - find . -type f -name 'nuttx-*-default.px4' -exec cp "{}" . \; + - 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 + - mkdir s3deploy-branch && mv *_default.px4 build_px4fmu-v2_default/parameters.xml build_px4fmu-v2_default/airframes.xml s3deploy-branch/ 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 +# 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: + branch: master + branch: beta + branch: stable + condition: $GCC_VER = 4.8 + +# 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: + branch: master + branch: beta + branch: stable + condition: $GCC_VER = 4.8 + +# 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 + condition: $GCC_VER = 4.8 notifications: webhooks: diff --git a/Makefile b/Makefile index 26aad575a8..bd6533e3e7 100644 --- a/Makefile +++ b/Makefile @@ -223,8 +223,8 @@ run_sitl_ros: sitl_deprecation # Other targets # -------------------------------------------------------------------- -.PHONY: gazebo_build uavcan_firmware check check_format unittest tests package_firmware clean submodulesclean distclean -.NOTPARALLEL: gazebo_build uavcan_firmware check check_format unittest tests package_firmware clean submodulesclean distclean +.PHONY: gazebo_build uavcan_firmware check check_format unittest tests qgc_firmware package_firmware clean submodulesclean distclean +.NOTPARALLEL: gazebo_build uavcan_firmware check check_format unittest tests qgc_firmware package_firmware clean submodulesclean distclean gazebo_build: @mkdir -p build_gazebo @@ -287,15 +287,20 @@ ifeq ($(VECTORCONTROL),1) endif unittest: posix_sitl_test - @export CC=clang - @export CXX=clang++ - @export ASAN_OPTIONS=symbolize=1 $(call cmake-build-other,unittest, ../unittests) @(cd build_unittest && ctest -j2 --output-on-failure) test_onboard_sitl: @HEADLESS=1 make posix_sitl_test gazebo_iris + +# QGroundControl flashable firmware +qgc_firmware: \ + check_px4fmu-v1_default \ + check_px4fmu-v2_default \ + check_mindpx-v2_default \ + check_px4fmu-v4_default_and_uavcan + package_firmware: @zip --junk-paths Firmware.zip `find . -name \*.px4` diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 5d39cc4bb7..2a628bb1f1 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 2.8) include(CMakeForceCompiler) -CMAKE_FORCE_C_COMPILER(clang Clang) -CMAKE_FORCE_CXX_COMPILER(clang++ Clang) +#CMAKE_FORCE_C_COMPILER(clang Clang) +#CMAKE_FORCE_CXX_COMPILER(clang++ Clang) if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") add_compile_options(-Qunused-arguments ) @@ -28,6 +28,7 @@ endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -g") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -fsanitize=address -fno-omit-frame-pointer") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare -Wno-unused-but-set-variable") set(GTEST_DIR ${CMAKE_SOURCE_DIR}/googletest) add_subdirectory(${GTEST_DIR})