Browse Source

Travis: split build by target instead of vehicle

This way we can group together the builds that are fast so we pay the
"setup price" just once.  Let the long PX4 build on its own VM because
it's the one that takes most of the time building NuttX.

By grouping the projects by target it's also easier to split the build
in more VMs if we want to speed up the build.
mission-4.1.18
Lucas De Marchi 10 years ago committed by Andrew Tridgell
parent
commit
ac09a61238
  1. 7
      .travis.yml
  2. 32
      Tools/scripts/build_all_travis.sh

7
.travis.yml

@ -21,11 +21,8 @@ env:
# via the "travis encrypt" command using the project repo's public key # via the "travis encrypt" command using the project repo's public key
- secure: "FjIwqZQV2FhNPWYITX5LZXTE38yYqBaQdbm3QmbEg/30wnPTm1ZOLIU7o/aSvX615ImR8kHoryvFPDQDWc6wWfqTEs3Ytq2kIvcIJS2Y5l/0PFfpWJoH5gRd6hDThnoi+1oVMLvj1+bhn4yFlCCQ2vT/jxoGfiQqqgvHtv4fLzI=" - secure: "FjIwqZQV2FhNPWYITX5LZXTE38yYqBaQdbm3QmbEg/30wnPTm1ZOLIU7o/aSvX615ImR8kHoryvFPDQDWc6wWfqTEs3Ytq2kIvcIJS2Y5l/0PFfpWJoH5gRd6hDThnoi+1oVMLvj1+bhn4yFlCCQ2vT/jxoGfiQqqgvHtv4fLzI="
matrix: matrix:
- TRAVIS_BUILD_TYPE=ArduPlane - TRAVIS_BUILD_TARGET="px4-v2"
- TRAVIS_BUILD_TYPE=ArduCopter - TRAVIS_BUILD_TARGET="sitl linux apm2 navio"
- TRAVIS_BUILD_TYPE=APMrover2
- TRAVIS_BUILD_TYPE=AntennaTracker
- TRAVIS_BUILD_TYPE=Tools/Replay
addons: addons:
coverity_scan: coverity_scan:

32
Tools/scripts/build_all_travis.sh

@ -10,12 +10,10 @@ set -x
. ~/.profile . ~/.profile
travis_build_type_or_empty() { # If TRAVIS_BUILD_TARGET is not set, default to all of them
if [ -z "$TRAVIS_BUILD_TYPE" ] || [ "$TRAVIS_BUILD_TYPE" = "$1" ]; then if [ -z "$TRAVIS_BUILD_TARGET" ]; then
return 0 TRAVIS_BUILD_TARGET="sitl linux apm2 navio px4-v2"
fi fi
return 1
}
declare -A build_platforms declare -A build_platforms
declare -A build_concurrency declare -A build_concurrency
@ -35,19 +33,21 @@ build_concurrency=(["apm2"]="-j2"
build_extra_clean=(["px4-v2"]="make px4-cleandep") build_extra_clean=(["px4-v2"]="make px4-cleandep")
for d in "${!build_platforms[@]}"; do echo "Targets: $TRAVIS_BUILD_TARGET"
if ! travis_build_type_or_empty "$d"; then for t in $TRAVIS_BUILD_TARGET; do
continue for v in ${!build_platforms[@]}; do
fi if [[ ${build_platforms[$v]} != *$t* ]]; then
continue
fi
echo "Building $v for ${t}..."
pushd $d pushd $v
for p in ${build_platforms["$d"]}; do
make clean make clean
if [ ${build_extra_clean[$p]+_} ]; then if [ ${build_extra_clean[$t]+_} ]; then
${build_extra_clean[$p]} ${build_extra_clean[$t]}
fi fi
make $p ${build_concurrency[$p]} make $t ${build_concurrency[$t]}
popd
done done
popd
done done

Loading…
Cancel
Save