-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
210 lines (199 loc) · 7.13 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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
language: cpp
matrix:
include:
- os: linux
dist: trusty
compiler: clang
addons:
apt:
packages:
- libgtk-3-dev
- libwebkitgtk-3.0-dev
env:
- COMPILER_CXX=clang++
- COMPILER_CC=clang
- SEEC_LLVM_BUILT_XZ_FILENAME="seec_llvm_travis_build_linux_clang.tar.xz"
- os: linux
dist: trusty
compiler: clang
addons:
apt:
sources:
- llvm-toolchain-trusty-4.0
packages:
- clang-4.0
- libgtk-3-dev
- libwebkitgtk-3.0-dev
env:
- COMPILER_CXX=clang++-4.0
- COMPILER_CC=clang-4.0
- SEEC_LLVM_BUILT_XZ_FILENAME="seec_llvm_travis_build_linux_clang.tar.xz"
- os: linux
dist: trusty
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
- libgtk-3-dev
- libwebkitgtk-3.0-dev
env:
- COMPILER_CXX=g++-6
- COMPILER_CC=gcc-6
- SEEC_LLVM_BUILT_XZ_FILENAME="seec_llvm_travis_build_linux_gcc.tar.xz"
- os: linux
dist: trusty
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
- libgtk-3-dev
- libwebkitgtk-3.0-dev
env:
- COMPILER_CXX=g++-7
- COMPILER_CC=gcc-7
- SEEC_LLVM_BUILT_XZ_FILENAME="seec_llvm_travis_build_linux_gcc.tar.xz"
- os: osx
osx_image: xcode7.3
compiler: clang
env:
- THE_OSX_IMAGE=xcode7.3
- COMPILER_CXX=clang++
- COMPILER_CC=clang
- os: osx
osx_image: xcode9
compiler: clang
env:
- THE_OSX_IMAGE=xcode9
- COMPILER_CXX=clang++
- COMPILER_CC=clang
#
# Cache dependency installations.
#
cache:
directories:
- $HOME/deps/install
before_install:
- export CXX="${COMPILER_CXX}" CC="${COMPILER_CC}"
- SEEC_LLVM_RELEASE_TAG="v6.0"
- SEEC_CLANG_RELEASE_TAG="v6.0_1.0"
- SEEC_WX_RELEASE_TAG="seec_travis_v3.0.3.1"
- ICU_SOURCE_URL="https://github.com/unicode-org/icu/releases/download/release-60-3/icu4c-60_3-src.tgz"
- CMAKE_URL="http://www.cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz"
- SEEC_VERSION_STRING="0.50.0"
install:
- DEPS_DIR="${HOME}/deps"
- DEPS_SRC="${DEPS_DIR}/src"
- DEPS_BUILD="${DEPS_DIR}/build"
- DEPS_INSTALL="${DEPS_DIR}/install"
- mkdir -p ${DEPS_DIR}
- mkdir -p ${DEPS_SRC}
- mkdir -p ${DEPS_BUILD}
- mkdir -p ${DEPS_INSTALL}
#
# LLVM needs a more recent version of CMake. This code comes from the following
# answer about installing an updated CMake:
# http://stackoverflow.com/a/33203355
#
- |
cd ${DEPS_INSTALL}
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
if [ ! -d "cmake" ]; then
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
fi
export PATH=${DEPS_INSTALL}/cmake/bin:${PATH}
fi
#
# Download pre-built LLVM, SeeC-Clang, and wxWidgets (separately).
#
- |
cd ${DEPS_INSTALL}
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
SEEC_LLVM_BUILT_XZ_FILENAME="seec_llvm_travis_build_${TRAVIS_OS_NAME}_${THE_OSX_IMAGE}_${CC}.tar.xz"
SEEC_CLANG_BUILT_XZ_FILENAME="seec_clang_travis_build_${TRAVIS_OS_NAME}_${THE_OSX_IMAGE}_${CC}.tar.xz"
WX_BUILT_XZ_FILENAME="seec_wx_travis_build_${TRAVIS_OS_NAME}_${THE_OSX_IMAGE}_${CC}.tar.xz"
else
SEEC_CLANG_BUILT_XZ_FILENAME="seec_clang_travis_build_${TRAVIS_OS_NAME}_${CC}.tar.xz"
WX_BUILT_XZ_FILENAME="seec_wx_travis_build_${TRAVIS_OS_NAME}_${CC}.tar.xz"
fi
if [ ! -d "include/llvm" ]; then
travis_retry wget --no-check-certificate --quiet -O - https://github.com/seec-team/llvm-with-seec-clang/releases/download/${SEEC_LLVM_RELEASE_TAG}/${SEEC_LLVM_BUILT_XZ_FILENAME} | tar -xJ
fi
if [ ! -d "include/clang" ]; then
travis_retry wget --no-check-certificate --quiet -O - https://github.com/seec-team/seec-clang/releases/download/${SEEC_CLANG_RELEASE_TAG}/${SEEC_CLANG_BUILT_XZ_FILENAME} | tar -xJ
fi
if [ ! -e "bin/wx-config" ]; then
travis_retry wget --no-check-certificate --quiet -O - https://github.com/seec-team/wxWidgets/releases/download/${SEEC_WX_RELEASE_TAG}/${WX_BUILT_XZ_FILENAME} | tar -xJ
fi
#
# For OS X, we also need to build and install ICU.
#
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
ICU_INSTALL_DIR="${DEPS_INSTALL}"
if [ ! -e "${ICU_INSTALL}/bin/icu-config" ]; then
cd ${DEPS_SRC}
ICU_SOURCE_URL="https://github.com/unicode-org/icu/releases/download/release-60-3/icu4c-60_3-src.tgz"
travis_retry wget --no-check-certificate --quiet -O - ${ICU_SOURCE_URL} | tar -x
cd icu/source
chmod +x runConfigureICU configure install-sh
./runConfigureICU MacOSX --enable-static --disable-shared --prefix=${ICU_INSTALL_DIR} CXXFLAGS="-std=c++11"
make -j4 && make install
fi
else
ICU_INSTALL_DIR="/usr"
fi
#
# Configure the SeeC build.
#
before_script:
- |
cd ${HOME}
mkdir seec-build && cd seec-build
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=${DEPS_INSTALL}/lib/cmake/llvm -DClang_DIR=${DEPS_INSTALL}/lib/cmake/clang -DWX_INSTALL=${DEPS_INSTALL} -DICU_INSTALL=${ICU_INSTALL_DIR} -DCMAKE_INSTALL_PREFIX=${HOME}/seec-install ${TRAVIS_BUILD_DIR}
#
# Build using the makefiles previously generated by CMake.
#
script:
- cd ${HOME}/seec-build
- make
#
# If the build is successful, install SeeC and run the tests.
#
after_success:
- |
mkdir -p ${HOME}/seec-install
mkdir -p ${HOME}/seec-test
cd ${HOME}/seec-build
make install
cd ${HOME}/seec-test
cmake -DSEEC_INSTALL=${HOME}/seec-install ${TRAVIS_BUILD_DIR}/tests
make && ctest -D Continuous
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
OSX_PACKAGE_DIR=${HOME}/seec-osx-package
mkdir -p ${OSX_PACKAGE_DIR}
cd ${OSX_PACKAGE_DIR}
${TRAVIS_BUILD_DIR}/packaging/osx/package_seec.sh ${SEEC_VERSION_STRING} ${HOME}/seec-install /Applications
mv "seec-${SEEC_VERSION_STRING}.pkg" "seec-${SEEC_VERSION_STRING}-${THE_OSX_IMAGE}.pkg"
fi
#
# For OS X, if this is tagged, then upload the package to GitHub.
#
deploy:
provider: releases
api_key:
secure: sfv/wVHWC0nuKqV95HeqA50NLK/rpR7jKy42MTMdG1gvU7IYdzAkav7fOk9lCs6rWKHdpVA9XBUk2nd6pNPm6/iYZH/VczzYQQv8/9Rsh2gYkvn/aGoSgJ7GzjUzs5L+EUbOHtEI/ddURSQQ6JDDk1qMJh+E2wlEr8nuAn+rJen/xTfB5YU+qkliBHR0Qm/P3iVm6OZapXFNG3/8G4mQagYDISc3DUuRnkjBMcFtb2bUlBh465vzXUHH0qik9Nw7jLKYSqcvpNDIBMAD/0PxGCRmnDhaCGUVx9UVCooNgmfBNd2pZWIDHGbCPDkNGeu3+KRbdwol3jV6MlRfVpafI6vO7b/ujFBgw7rm7MwwcKMIIpMXrD3HwDFy+/dTZVFz8+jOuH7pqjl4L1soIItGPYW67A7UshtTOegLBDRoj/BIv3ZlwOFr0WWe0XYmfL2on/nvmwhw0yhTIEH7I5knCex+xrpiUnPuDdfM1Hj308QD9AmJahWmZl0DgEe3GIvHN9kBVNtdBL5nsYPWpz75FpVXpI5sKLpgwHIJCIOFjjDCoMy+MKD7r+5w2poz18yfzvNfHxHNFOZ1NobGLPOFgNNUx8YTopzYybx9+2oeAHGErLWKBpWCpp00/28uvp9aGKwiNMFf2Az853Pb2GLDXK/WxlPYjsJu8xJ7MjCd3dM=
file: "${OSX_PACKAGE_DIR}/seec-${SEEC_VERSION_STRING}-${THE_OSX_IMAGE}.pkg"
skip_cleanup: true
on:
condition: "${TRAVIS_OS_NAME} = osx"
tags: true
repo: seec-team/seec