Skip to content

Commit 25698c3

Browse files
authored
Merge pull request #22 from OpenSimulationInterface/add-travis-yaml
Add travis yaml
2 parents a56c22f + f8394f7 commit 25698c3

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
build/
12
CMakeCache.txt
23
CMakeFiles
34
CMakeScripts

.travis.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Source: https://github.com/boostorg/hana/blob/master/.travis.yml
2+
3+
# Sudo is required for installing recent versions of dependencies.
4+
sudo: required
5+
6+
# Use C++ build environment.
7+
language: cpp
8+
9+
# Protobuf requires g++ (see https://github.com/google/protobuf/blob/master/src/README.md)
10+
compiler:
11+
- gcc
12+
13+
# Cache dependencies to speed up the build.
14+
cache:
15+
directories:
16+
- ${TRAVIS_BUILD_DIR}/deps/cmake
17+
- ${TRAVIS_BUILD_DIR}/deps/protobuf
18+
19+
# Handle dependencies in separate directory.
20+
before_install:
21+
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
22+
- mkdir -p "${DEPS_DIR}"
23+
- cd "${DEPS_DIR}"
24+
25+
install:
26+
# Install a recent version of CMake
27+
- |
28+
CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
29+
mkdir -p cmake
30+
travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
31+
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
32+
33+
# Install a recent version of the Protobuf
34+
- |
35+
PROTOBUF_URL="https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz"
36+
mkdir -p protobuf
37+
travis_retry wget --no-check-certificate --quiet -O - ${PROTOBUF_URL} | tar --strip-components=1 -xz -C protobuf
38+
cd protobuf
39+
./configure --prefix=/usr
40+
make
41+
sudo make install
42+
43+
# Change directory back to default build directory.
44+
before_script:
45+
- cd "${TRAVIS_BUILD_DIR}"
46+
47+
# Run the build script.
48+
script:
49+
- mkdir -p build
50+
- cd build
51+
- cmake ..
52+
- cmake --build .

0 commit comments

Comments
 (0)