From b247dac120a188d706deddc6950e3356c9fb42e8 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Wed, 22 Jun 2016 17:42:49 -0400 Subject: [PATCH] travis-ci optimizations (#4870) * move gcc 4.9 build to circleci * travis-ci update to xcode 7.3 * travis-ci limit git fetching for OSX * Makefile split firmware targets for CI * OSX ccache --- .travis.yml | 34 ++++++++++++++++------------------ Makefile | 9 ++++++++- circle.yml | 4 ++-- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index 527b0e3ab2..a1b414b113 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,6 @@ language: cpp -env: - global: - # build thiemar/vectorcontrol.git and include in px4fmu-v4 - - VECTORCONTROL=1 - matrix: fast_finish: true include: @@ -16,30 +11,31 @@ matrix: env: GCC_VER=4.8 DOCKER_REPO="px4io/px4-dev-base" services: - docker - - os: linux - sudo: required - env: GCC_VER=4.9 DOCKER_REPO="px4io/px4-dev-nuttx-gcc4.9" - services: - - docker - os: osx - osx_image: xcode7 sudo: true + osx_image: xcode7.3 + env: CCACHE_CPP2=1 cache: + ccache: true + pip: true directories: - - $HOME/.ccache + - $HOME/.pip/cache/ + - $HOME/Library/Caches/pip before_install: - - cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --all --tags && git submodule update --quiet --init --recursive - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then - docker pull ${DOCKER_REPO}; + git fetch --unshallow && git fetch --all --tags + && docker pull ${DOCKER_REPO} + ; elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew tap PX4/homebrew-px4 - && brew update; brew update - && brew install cmake ninja - && brew install genromfs + && brew update + && brew update + && brew install ccache cmake ninja genromfs && sudo easy_install pip && sudo pip install empy + && export PATH=/usr/local/opt/ccache/libexec:$PATH ; fi @@ -52,11 +48,13 @@ env: - PX4_AWS_BUCKET=px4-travis script: + - ccache -M 1GB; ccache -z - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then - 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 "make qgc_firmware"; + 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 "make check_qgc_firmware VECTORCONTROL=1"; elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then make check_posix_sitl_default; fi + - ccache -s after_success: - make package_firmware && mkdir s3deploy-archive && cp Firmware.zip s3deploy-archive/ diff --git a/Makefile b/Makefile index 05426971a7..f8c34223a8 100644 --- a/Makefile +++ b/Makefile @@ -289,7 +289,9 @@ endif unittest: posix_sitl_test $(call cmake-build-other,unittest, ../unittests) @(cd build_unittest && ctest -j2 --output-on-failure) - + +tests: posix_sitl_test unittest + test_onboard_sitl: @HEADLESS=1 make posix_sitl_test gazebo_iris @@ -301,6 +303,11 @@ qgc_firmware: \ check_mindpx-v2_default \ check_px4fmu-v4_default_and_uavcan +extra_firmware: \ + check_px4-stm32f4discovery_default \ + check_px4fmu-v2_test \ + check_px4fmu-v2_ekf2 + package_firmware: @zip --junk-paths Firmware.zip `find . -name \*.px4` diff --git a/circle.yml b/circle.yml index 7f87ee6381..4eae4127a7 100644 --- a/circle.yml +++ b/circle.yml @@ -10,10 +10,10 @@ checkout: ## Customize dependencies dependencies: pre: - - docker pull px4io/px4-dev-base + - docker pull px4io/px4-dev-nuttx-gcc4.9 - docker info test: override: #- sudo docker run --rm -v `pwd`:`pwd`:rw -v $HOME/.ccache:$HOME/.ccache:rw -e CCACHE_DIR=$HOME/.ccache -w=`pwd` --user=$UID -it px4io/px4-dev-base /bin/bash -c "make" - - docker run -v `pwd`:`pwd`:rw -w=`pwd` --user=$UID -it px4io/px4-dev-base /bin/bash -c "make" + - docker run -v `pwd`:`pwd`:rw -w=`pwd` --user=$UID -it px4io/px4-dev-nuttx-gcc4.9 /bin/bash -c "make px4fmu-v4_default"