Browse Source

For Travis CI - use Release build configuration when build on bad VM.
Now this rule is applicable for all target platforms (Linux, Windows, Android, and Raspberry-Pi) which have their CI builds run on Linux/Ubuntu host VM. Mac OSX and iOS CI builds are not affected by this rule since they run on OSX host VM which is not susceptible to "bad VM" issue. The idea is to reduce memory consumption during the linking phase and thus avoiding the process being killed due to insufficient memory in the VM.

Yao Wei Tjong 姚伟忠 11 years ago
parent
commit
aaec0d9200
2 changed files with 3 additions and 2 deletions
  1. 1 0
      .travis.yml
  2. 2 2
      Rakefile

+ 1 - 0
.travis.yml

@@ -54,6 +54,7 @@ matrix:
       env: LINUX=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0
       env: LINUX=1 URHO3D_LIB_TYPE=SHARED URHO3D_64BIT=0
 before_install:
 before_install:
   - free -tm
   - free -tm
+  - mem=($(free -m |head -2 |tail -1)); if [ ${mem[6]} -eq 0 ]; then export BAD_VM=1; fi
   - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
   - export TAG=$(git describe --exact-match $TRAVIS_COMMIT 2>/dev/null); if [[ $TAG =~ [[:digit:]]+\.[[:digit:]]+ ]]; then export RELEASE_TAG=$TAG; fi
   - if [ $RELEASE_TAG ] || ([ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]); then export SITE_UPDATE_ON_MASTER_COMMIT=$SITE_UPDATE; export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT); if [ "$CC" == "gcc" ] && ([ $RELEASE_TAG ] || echo $COMMIT_MESSAGE |grep -cq '\[ci package\]'); then export PACKAGE_UPLOAD=1; fi; fi
   - if [ $RELEASE_TAG ] || ([ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]); then export SITE_UPDATE_ON_MASTER_COMMIT=$SITE_UPDATE; export COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT); if [ "$CC" == "gcc" ] && ([ $RELEASE_TAG ] || echo $COMMIT_MESSAGE |grep -cq '\[ci package\]'); then export PACKAGE_UPLOAD=1; fi; fi
   - if [ "$SITE_UPDATE_ON_MASTER_COMMIT" -o "$PACKAGE_UPLOAD" ]; then travis_retry sudo add-apt-repository ppa:george-edison55/precise-backports -y; fi
   - if [ "$SITE_UPDATE_ON_MASTER_COMMIT" -o "$PACKAGE_UPLOAD" ]; then travis_retry sudo add-apt-repository ppa:george-edison55/precise-backports -y; fi

+ 2 - 2
Rakefile

@@ -76,8 +76,8 @@ task :ci do
   if ENV['CI'] && ENV['PACKAGE_UPLOAD'] && !ENV['RELEASE_TAG']
   if ENV['CI'] && ENV['PACKAGE_UPLOAD'] && !ENV['RELEASE_TAG']
     system 'git fetch --unshallow' or abort 'Failed to unshallow cloned repository'
     system 'git fetch --unshallow' or abort 'Failed to unshallow cloned repository'
   end
   end
-  # Packaging always use Release configuration (temporary workaround due to Travis-CI insufficient memory, also always use Release configuration for MinGW and Android build)
-  if ENV['PACKAGE_UPLOAD'] || (ENV['CI'] && (ENV['WINDOWS'] || ENV['ANDROID']))
+  # Packaging always use Release configuration (temporary workaround due to Travis-CI insufficient memory, also use Release configuration when CI build runs on a bad VM)
+  if ENV['PACKAGE_UPLOAD'] || ENV['BAD_VM']
     $configuration = 'Release'
     $configuration = 'Release'
     $testing = 0
     $testing = 0
   else
   else