forked from simbody/simbody
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
69 lines (58 loc) · 2.93 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
# This script is used by the Travis-CI (continuous integration) testing
# framework to run Simbody's tests with every GitHub push or pull-request.
language: cpp
os:
- linux
- osx
compiler:
- gcc
- clang
env:
# Each line is a separate build in the build matrix. A build in the build
# matrix is defined by the environment variables defined on the line, which
# should be space-delimited. For example,
# - ABC=ON DEF=OFF GHI=ON
# Simbody 3.6 and up requires c++11
- BTYPE=Release
matrix:
exclude:
- os: osx
compiler: gcc
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 update; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install liblapack-dev; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install freeglut3-dev libxi-dev libxmu-dev; fi
# C++11 on Ubuntu. Update to gcc 4.8, which provides full C++11 support. We
# use this script because if building Simbody with C++11, we need gcc-4.8,
# 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.8. 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 update -qq; fi
- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then sudo apt-get install -qq g++-4.8; fi
- if [[ "$TRAVIS_OS_NAME" = "linux" && "$CXX" = "g++" ]]; then export CXX="g++-4.8" CC="gcc-4.8"; 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 update -qq; fi
- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then sudo apt-get install cmake; fi
install:
- mkdir ~/simbody-build && cd ~/simbody-build
# Configure.
- cmake $TRAVIS_BUILD_DIR -DCMAKE_BUILD_TYPE=$BTYPE -DCMAKE_CXX_FLAGS=-Werror
# Build.
- make -j8
script:
## Test Simbody.
- ctest -j8 --output-on-failure
## Make sure we can install with no issues.
- sudo make -j8 install