forked from simbody/simbody
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
98 lines (86 loc) · 4.16 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# This script is used by the Travis-CI (continuous integration) testing
# framework to run Simbody's tests with every GitHub push or pull-request.
#
# Ask for Ubuntu "trusty" (14.04) to pick up newer compilers. Still have
# to upgrade gcc from trusty's 4.8 to 4.9 though, because 4.8 didn't support
# C++11 regular expressions.
sudo: required
dist: trusty
language: cpp
matrix:
include:
- os: linux
compiler: clang
env: BTYPE=RelWithDebInfo
- os: linux
compiler: gcc
env: BTYPE=Release
- os: linux
compiler: clang
env: BTYPE=Debug
- os: osx
compiler: clang
env: BTYPE=RelWithDebInfo
before_install:
## Ensure that there are no tabs in source code.
# GREP returns 0 (true) if there are any matches, and
# we don't want any matches. If there are matches,
# print a helpful message, and make the test fail by using "false".
# The GREP command here checks for any tab characters in the the files
# that match the specified pattern. GREP does not pick up explicit tabs
# (e.g., literally a \t in a source file).
# This grep command is invalid on osx.
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then if grep --recursive --include={*.cpp,*.c,*.h,*.md,*.yml,*.cmake.*.xml,*.html,*.in,*.txt} -P "\t" . ; then echo "Tabs found in the lines shown above. See CONTRIBUTING.md about tabs."; false; else echo "Repo passed no-tabs check."; fi; else echo "No-tabs check not performed."; fi
## Dependencies for Simbody.
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes update; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes install liblapack-dev; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes install freeglut3-dev libxi-dev libxmu-dev; fi
# C++11 on Ubuntu. Update to gcc 4.9, which provides full C++11 support. We
# use this script because if building Simbody with C++11, we need gcc-4.9,
# and the Travis Ubuntu 12.04 machines have an older version of gcc. Even if
# building with Clang, we need the newer libstdc++ that we get by updating to
# gcc-4.9. See https://github.com/travis-ci/travis-ci/issues/979.
- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y; fi
- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then sudo apt-get --yes update -qq; fi
- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then sudo apt-get --yes install -qq g++-4.9; fi
- if [[ "$TRAVIS_OS_NAME" = "linux" && "$CXX" = "g++" ]]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
# CMake 2.8.11 on Ubuntu.
#- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then sudo add-apt-repository ppa:kalakris/cmake -y; fi
#- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then sudo apt-get --yes update -qq; fi
#- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then sudo apt-get --yes install cmake; fi
install:
- mkdir ~/simbody-build && cd ~/simbody-build
# Configure.
- cmake $TRAVIS_BUILD_DIR -DCMAKE_BUILD_TYPE=$BTYPE -DCMAKE_CXX_FLAGS=-Werror -DCMAKE_INSTALL_PREFIX=~/simbody
# Build.
- make -j8
script:
## Test Simbody.
- ctest -j8 --output-on-failure
## Make sure we can install with no issues.
- make -j8 install
before_deploy:
# Zip up the installation using a file name that identifies where
# the binaries were built.
- mkdir ~/binstar-packages
- ZIPNAME=simbody-latest_${TRAVIS_OS_NAME}_${BTYPE}.zip
- # Zip up simbody relative to the home directory; must change to home dir.
- cd ~
- zip --recurse-paths --quiet ~/binstar-packages/$ZIPNAME simbody
# Paths in the .bintray.json file are relative to the current directory.
- cd ~
deploy:
# Uploads to https://bintray.com/chrisdembia/opensim-testing/simbody/view
# https://dl.bintray.com/chrisdembia/opensim-testing/
# See http://docs.travis-ci.com/user/deployment/bintray/ for help.
provider: bintray
file: $TRAVIS_BUILD_DIR/doc/.bintray.json
user: chrisdembia
skip_cleanup: true
# API key is encrypted with travis.
key:
secure: MOCuM6THnBR82ClEmWFmqVM/GEiNtimz7dMmWUnmgU4gWAU9DBq0OelifQ6XAAhEqZGz0IbVyRo+zDGWRUEC/EIAb9PhTSg6W/XX+zykAQCsIr3BMvOE6v5MXNz/JMFKxZoFmmrL1WR4a4KUOQANr7derYkIZUy/9CnUkJgQGKE=
on:
# Upload for both linux and OSX.
branch: master
condition: "$CC = clang"