Skip to content

Commit

Permalink
[travis] First pass at caching again.
Browse files Browse the repository at this point in the history
[skip appveyor]
  • Loading branch information
chrisdembia committed Jun 25, 2017
1 parent 85ab51a commit 57bad01
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 254 deletions.
74 changes: 0 additions & 74 deletions .github/DownloadBuildFromCache.sh

This file was deleted.

65 changes: 0 additions & 65 deletions .github/DownloadDepBuildFromCache.sh

This file was deleted.

17 changes: 0 additions & 17 deletions .github/FindTestsToExclude.sh

This file was deleted.

62 changes: 0 additions & 62 deletions .github/UploadBuildToCache.sh

This file was deleted.

58 changes: 22 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ env:
- OPENSIM_DEPENDENCIES_INSTALL_DIR=~/opensim_dependencies-install
- SWIG_VER=3.0.8
- PATH="$PATH:$TRAVIS_BUILD_DIR/.github"
- USE_CACHE=false
- USE_CCACHE=1
- CCACHE_COMPRESS=1
# For Clang to work with ccache.
- CCACHE_CPP2=1

cache: false
cache: ccache

addons:
# Dependencies on linux.
Expand Down Expand Up @@ -89,13 +92,13 @@ before_install:
# `/Users/travis/build.sh: line 109: shell_session_update: command not found`
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then rvm get head; fi

###########################################################################################################
#############################################################################
# Temporary fix until llvm.org/apt is back up. Manually download clang binaries and use them.
- if [[ "$TRAVIS_OS_NAME" = "linux" && $CC = *clang* ]]; then cd && wget http://llvm.org/releases/3.5.0/clang+llvm-3.5.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz; fi
- if [[ "$TRAVIS_OS_NAME" = "linux" && $CC = *clang* ]]; then tar -xJf clang+llvm-3.5.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz; fi
- if [[ "$TRAVIS_OS_NAME" = "linux" && $CC = *clang* ]]; then export CC="$HOME/clang+llvm-3.5.0-x86_64-linux-gnu/bin/clang"; fi
- if [[ "$TRAVIS_OS_NAME" = "linux" && $CXX = *clang* ]]; then export CXX="$HOME/clang+llvm-3.5.0-x86_64-linux-gnu/bin/clang++"; fi
###########################################################################################################
#############################################################################

## Ensure that there are no tabs in source code.
# GREP returns 0 (true) if there are any matches, and
Expand All @@ -112,6 +115,9 @@ before_install:
# to use the new gcc.
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi

- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install ccache; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then PATH=/usr/local/opt/ccache/libexec:$PATH; fi

# Temporary fix until llvm.org/apt is up again. See above.
# - if [[ "$TRAVIS_OS_NAME" = "linux" && "$CXX" = "clang++" ]]; then export CXX="clang++-3.5" CC="clang-3.5"; fi

Expand Down Expand Up @@ -164,57 +170,29 @@ before_install:
- mkdir $OPENSIM_DEPENDENCIES_BUILD_DIR
- cd $OPENSIM_DEPENDENCIES_BUILD_DIR
- cmake $TRAVIS_BUILD_DIR/dependencies -DCMAKE_INSTALL_PREFIX=$OPENSIM_DEPENDENCIES_INSTALL_DIR -DCMAKE_BUILD_TYPE=$BTYPE -DSUPERBUILD_simbody=OFF
#######################################################################################################################
# Download the cached build directory, if one exists.
#######################################################################################################################
- BTK_SOURCE_DIR="${TRAVIS_BUILD_DIR}/dependencies/BTK"
- BTK_BUILD_DIR="${OPENSIM_DEPENDENCIES_BUILD_DIR}/BTK"
- source DownloadDepBuildFromCache.sh BTKCore $BTK_SOURCE_DIR $BTK_BUILD_DIR

- make -j8

#######################################################################################################################
# Cache BTK build directory.
#######################################################################################################################
- source UploadBuildToCache.sh BTKCore $BTK_SOURCE_DIR $BTK_BUILD_DIR

# Force some cleanup of homebrew cache so we do not exceed availabe disk space
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew cleanup; rm -rf "`brew cache`"; fi


install:
#######################################################################################################################
# Download the cached build directory, if one exists.
#######################################################################################################################
- source DownloadBuildFromCache.sh opensim-core $TRAVIS_BUILD_DIR ~/opensim-core-build

#######################################################################################################################
#############################################################################
# Configure OpenSim.
#######################################################################################################################
#############################################################################
- cd ~/opensim-core-build
- cmake $TRAVIS_BUILD_DIR -DBUILD_JAVA_WRAPPING=$WRAP -DBUILD_PYTHON_WRAPPING=$WRAP -DSWIG_EXECUTABLE=$HOME/swig/bin/swig -DSIMBODY_HOME=~/simbody -DOPENSIM_DEPENDENCIES_DIR=$OPENSIM_DEPENDENCIES_INSTALL_DIR -DCMAKE_INSTALL_PREFIX=$OPENSIM_HOME -DCMAKE_BUILD_TYPE=$BTYPE -DCMAKE_CXX_FLAGS="$CXX_FLAGS" -DDOXYGEN_EXECUTABLE=$HOME/doxygen/doxygen-1.8.10/bin/doxygen -DOPENSIM_DOXYGEN_USE_MATHJAX=off -DOPENSIM_SIMBODY_DOXYGEN_LOCATION="https://simtk.org/api_docs/simbody/latest/" -DWITH_BTK:BOOL=ON

#######################################################################################################################
#############################################################################
# Build OpenSim.
#######################################################################################################################
- BUILD_START_TIMESTAMP=$(date +%s)
#############################################################################
# Build java and python C++ wrapper separately to avoid going over the memory limit.
- if [[ "$WRAP" = "on" ]]; then make -j$NPROC osimTools osimJavaJNI PythonBindings; fi
# Build whatever remains (at least _opensim, tests and examples).
- make -j$NPROC;

#######################################################################################################################
# Cache OpenSim build directory if current branch is master.
#######################################################################################################################
- source UploadBuildToCache.sh opensim-core $TRAVIS_BUILD_DIR ~/opensim-core-build
- cd ~/opensim-core-build

script:
#######################################################################################################################
# Find tests to exclude. Add them to TESTS_TO_EXCLUDE.
#######################################################################################################################
- source FindTestsToExclude.sh

# Test OpenSim.
# TODO On Debug, we need to tell travis not to timeout if it doesn't get
# any output for more than 10 minutes. We do this using "travis_wait".
Expand Down Expand Up @@ -270,6 +248,14 @@ script:
# We delete folders older than 30 days (`-mtime +30`).
# The "shutdown" command shuts down the ssh environment.
- if [ $CLEAN_UP_MYOSIN = "0" ]; then ssh opensim-bot,[email protected] 'cd /home/project-web/myosin/htdocs && find . -mindepth 1 -maxdepth 1 -type d -mtime +30 | xargs rm -rf && shutdown'; fi

# Set the maximum size of the cache.
# TODO 100 MB is not big enough. Using default limit of 1 GB for now.
#- ccache --max-size 100M

before_cache:
# Show cache statistics.
- ccache --show-stats

before_deploy:
# Zip up the installation using a file name that identifies where
Expand Down

0 comments on commit 57bad01

Please sign in to comment.