-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
102 lines (90 loc) · 3.29 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
99
100
101
102
# Source: https://github.com/boostorg/hana/blob/master/.travis.yml
# Use C++ build environment.
language: cpp
# Protobuf requires g++ (see https://github.com/google/protobuf/blob/master/src/README.md)
compiler:
- gcc
# Cache dependencies to speed up the build.
cache:
directories:
- ${HOME}/deps/cmake
- ${HOME}/deps/protobuf
# - ${HOME}/deps/proto2cpp
# Handle dependencies in separate directory.
before_install:
- TESTINST_DIR="${HOME}/dummy"
- mkdir -p "${TESTINST_DIR}"
- DEPS_DIR="${HOME}/deps"
- mkdir -p "${DEPS_DIR}"
- cd "${DEPS_DIR}"
# Install necessary packages.
install:
# Install a recent version of CMake
- |
CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
if [ ! -f ${DEPS_DIR}/cmake/bin/cmake ] ; then mkdir -p cmake ; travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake ; fi
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
# Install a recent version of the Protobuf
- |
PROTOBUF_URL="https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz"
if [ ! -f ${DEPS_DIR}/protobuf/install/bin/protoc ] ; then mkdir -p protobuf ; travis_retry wget --no-check-certificate --quiet -O - ${PROTOBUF_URL} | tar --strip-components=1 -xz -C protobuf ; cd protobuf ; ./configure --prefix=${DEPS_DIR}/protobuf/install ; make ; make install ; fi
export PATH=${DEPS_DIR}/protobuf/install/bin:${PATH}
# Install proto2cpp for doxygen
- |
PROTO2CPP_URL="https://github.com/OpenSimulationInterface/proto2cpp.git"
if [ ! -f ${DEPS_DIR}/proto2cpp ] ; then mkdir -p proto2cpp ; git clone ${PROTO2CPP_URL} ${DEPS_DIR}/proto2cpp ; fi
# Environment variables.
env:
global:
- GH_REPO_ORG=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 1`
- GH_REPO_NAME=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 2`
- GH_REPO_REF="github.com/$GH_REPO_ORG/$GH_REPO_NAME.git"
# Addons necessary for documentation.
addons:
apt:
packages:
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen-gui
- graphviz
# Change directory back to default build directory.
before_script:
- cd "${TRAVIS_BUILD_DIR}"
# Run the build script and generate documentation.
script:
- mkdir -p build
- cd build
- cmake -D CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install -D CMAKE_INSTALL_PREFIX:PATH=${TESTINST_DIR} ..
- cmake --build .
- cd ..
- python test_cases.py
- python setup.py build
- python setup.py sdist
- cd build
- cmake --build . --target install
- cd ..
- cp VERSION VERSION.SAVED
- echo "" >> VERSION
- echo "VERSION_PATCH = \"GitHub_MasterBranch\"" >> VERSION
- cd build
- cmake -D FILTER_PROTO2CPP_PY_PATH=${DEPS_DIR}/proto2cpp ..
- doxygen
- cd ..
- python test_cases_doc.py
- mv VERSION.SAVED VERSION
- sh convert-to-proto3.sh
- mkdir -p build3
- cd build3
- cmake -D CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install ..
- cmake --build .
- cd ..
# Deploy the documentation on github (only for master branch).
deploy:
provider: pages
skip_cleanup: true
local_dir: doc/html
keep-history: true
github_token: ${GH_REPO_TOKEN}
on:
branch: master