-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
161 lines (145 loc) · 5.5 KB
/
.travis.yml
File metadata and controls
161 lines (145 loc) · 5.5 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Source: https://github.com/boostorg/hana/blob/master/.travis.yml
# Use distribution Ubuntu 18.04 Bionic
dist: bionic
# 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
- python3-setuptools
- python3-pip
- python3-wheel
jobs:
include:
# Run the build script and generate documentation.
- stage: test OSI protobuf
name: 'Test protobuf 2.6.1 syntax'
script:
- cd "${TRAVIS_BUILD_DIR}"
- 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 ..
- python3 setup.py build
- python3 setup.py sdist
- python3 -m pip install -U pip
- python3 -m pip install .
- 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 ..
- echo "EXCLUDE_PATTERNS = */osi3/*" >> Doxyfile
- echo "GENERATE_TREEVIEW = YES" >> Doxyfile
- doxygen
- cd ..
- python3 -m unittest discover tests
- script:
- cd "${TRAVIS_BUILD_DIR}"
- bash convert-to-proto3.sh
- rm *.pb2
- 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 ..
- python3 setup.py build
- python3 setup.py sdist
- python3 -m pip install -U pip
- python3 -m pip install .
- 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 ..
- echo "EXCLUDE_PATTERNS = */osi3/*" >> Doxyfile
- echo "GENERATE_TREEVIEW = YES" >> Doxyfile
- doxygen
- cd ..
- python3 -m unittest discover tests
name: 'Test protobuf 3.0.0 syntax'
- stage: deploy
script:
- cd "${TRAVIS_BUILD_DIR}"
- 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 ..
- python3 setup.py build
- python3 setup.py sdist
- python3 -m pip install -U pip
- python3 -m pip install .
- 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 ..
- echo "EXCLUDE_PATTERNS = */osi3/*" >> Doxyfile
- echo "GENERATE_TREEVIEW = YES" >> Doxyfile
- doxygen
- cd ..
- python3 -m unittest discover tests
# 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