-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
189 lines (145 loc) · 5.69 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
# === Common ===
sudo: false
language: cpp
env:
global:
# NOTE: LibCMaker lib name.
# NOTE: See below the lib deps in 'before_install' for every target OS.
- cmr_LIB_NAME=Dirent
- cmr_BUILD_TESTING=ON
- cmr_WORK_DIR=${HOME}
- cmr_REPO_DIR=${HOME}/build/LibCMaker/LibCMaker_${cmr_LIB_NAME}
- cmr_SAMPLE_SRC_DIR=${cmr_REPO_DIR}/samples/TestCompileWith${cmr_LIB_NAME}
- cmr_SAMPLE_DIR=${cmr_WORK_DIR}/TestCompileWith${cmr_LIB_NAME}
- cmr_SAMPLE_LIB_DIR=${cmr_SAMPLE_DIR}/libs
- cmr_BUILD_DIR=${cmr_SAMPLE_DIR}/build
- cmr_INSTALL_DIR=${cmr_BUILD_DIR}/install
- cmr_DOWNLOAD_DIR=${cmr_BUILD_DIR}/download
- cmr_JOBS_CNT=4
# === Windows ===
build_windows: &build_windows
stage: Test
os: windows
env: &build_windows_env
- cmr_TARGET_OS=windows
- cmr_CMAKE_RELEASE=cmake-3.11.0-win64-x64
- cmr_CMAKE_DIR=${cmr_INSTALL_DIR}/${cmr_CMAKE_RELEASE}
- cmr_CMAKE_CMD=${cmr_CMAKE_DIR}/bin/cmake
- cmr_CTEST_CMD=${cmr_CMAKE_DIR}/bin/ctest
- cmr_CMAKE_BUILD_TYPE=Release
- PATH=${cmr_INSTALL_DIR}/bin:${PATH}
before_install:
- cp -r ${cmr_SAMPLE_SRC_DIR} ${cmr_WORK_DIR}
- mkdir ${cmr_SAMPLE_LIB_DIR}
- cp -r ${cmr_REPO_DIR} ${cmr_SAMPLE_LIB_DIR}
- mkdir ${cmr_BUILD_DIR}
- mkdir ${cmr_INSTALL_DIR}
- mkdir ${cmr_DOWNLOAD_DIR}
- wget -nv -c -N -P ${cmr_DOWNLOAD_DIR} https://cmake.org/files/v3.11/${cmr_CMAKE_RELEASE}.zip
- 7z.exe x -aoa -o${cmr_INSTALL_DIR} ${cmr_DOWNLOAD_DIR}/${cmr_CMAKE_RELEASE}.zip
# NOTE: LibCMaker lib deps.
- git clone https://github.com/LibCMaker/LibCMaker.git ${cmr_SAMPLE_LIB_DIR}/LibCMaker
- git clone https://github.com/LibCMaker/LibCMaker_GoogleTest.git ${cmr_SAMPLE_LIB_DIR}/LibCMaker_GoogleTest
script:
- cd ${cmr_BUILD_DIR}
- ${cmr_CMAKE_CMD} ${cmr_SAMPLE_DIR}
-Dcmr_BUILD_MULTIPROC_CNT=${cmr_JOBS_CNT}
-Dcmr_PRINT_DEBUG=ON
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_COLOR_MAKEFILE=ON
-DBUILD_TESTING=${cmr_BUILD_TESTING}
-DCMAKE_INSTALL_PREFIX=${cmr_INSTALL_DIR}
-Dcmr_DOWNLOAD_DIR=${cmr_DOWNLOAD_DIR}
-Dcmr_UNPACKED_DIR=${cmr_DOWNLOAD_DIR}/unpacked
-DCMAKE_BUILD_TYPE=${cmr_CMAKE_BUILD_TYPE}
-DBUILD_SHARED_LIBS=${cmr_BUILD_SHARED_LIBS}
-DCMAKE_GENERATOR="${cmr_CMAKE_GENERATOR}"
-DCMAKE_GENERATOR_PLATFORM="${cmr_CMAKE_GENERATOR_PLATFORM}"
-DCMAKE_GENERATOR_TOOLSET="${cmr_CMAKE_GENERATOR_TOOLSET}"
-DCMAKE_CONFIGURATION_TYPES=${cmr_CMAKE_BUILD_TYPE}
- ${cmr_CMAKE_CMD} --build . --config ${cmr_CMAKE_BUILD_TYPE}
- ${cmr_CTEST_CMD} --output-on-failure --build-config ${cmr_CMAKE_BUILD_TYPE}
build_windows_msvc: &build_windows_msvc
<<: *build_windows
env: &build_windows_msvc_env
- *build_windows_env
- cmr_CMAKE_GENERATOR="Visual Studio 15 2017"
build_windows_msvc_x64: &build_windows_msvc_x64
<<: *build_windows_msvc
env: &build_windows_msvc_x64_env
- *build_windows_msvc_env
- cmr_CMAKE_GENERATOR_PLATFORM="x64"
- cmr_CMAKE_GENERATOR_TOOLSET="v141,host=x64"
build_windows_msvc_x32: &build_windows_msvc_x32
<<: *build_windows_msvc
env: &build_windows_msvc_x32_env
- *build_windows_msvc_env
- cmr_CMAKE_GENERATOR_PLATFORM="Win32"
- cmr_CMAKE_GENERATOR_TOOLSET="v141,host=x64"
build_windows_msvc_winxp: &build_windows_msvc_winxp
<<: *build_windows_msvc
env: &build_windows_msvc_winxp_env
- *build_windows_msvc_env
- cmr_CMAKE_GENERATOR_PLATFORM="Win32"
- cmr_CMAKE_GENERATOR_TOOLSET="v141_xp,host=x64"
# === Build matrix ===
jobs:
include:
# Windows, msvc
- <<: *build_windows_msvc_x64
name: "Windows, msvc, x64, shared"
if: branch = do_not_build_with_travis_ci
env:
- *build_windows_msvc_x64_env
- cmr_BUILD_SHARED_LIBS=ON
- <<: *build_windows_msvc_x64
name: "Windows, msvc, x64, static"
if: branch = do_not_build_with_travis_ci
env:
- *build_windows_msvc_x64_env
- cmr_BUILD_SHARED_LIBS=OFF
- <<: *build_windows_msvc_x32
name: "Windows, msvc, x32, shared"
if: branch = do_not_build_with_travis_ci
env:
- *build_windows_msvc_x32_env
- cmr_BUILD_SHARED_LIBS=ON
- <<: *build_windows_msvc_x32
name: "Windows, msvc, x32, static"
if: branch = do_not_build_with_travis_ci
env:
- *build_windows_msvc_x32_env
- cmr_BUILD_SHARED_LIBS=OFF
- <<: *build_windows_msvc_winxp
name: "Windows, msvc, winxp, shared"
if: branch = do_not_build_with_travis_ci
env:
- *build_windows_msvc_winxp_env
- cmr_BUILD_SHARED_LIBS=ON
- <<: *build_windows_msvc_winxp
name: "Windows, msvc, winxp, static"
if: branch = do_not_build_with_travis_ci
env:
- *build_windows_msvc_winxp_env
- cmr_BUILD_SHARED_LIBS=OFF
# Trigger the building of the dependent libs.
- stage: Trigger downstreams
name: "Trigger downstreams"
if: branch = skipped # TODO: remove it after fix Windows build with secure vars and add secure var TRAVIS_ACCESS_TOKEN.
before_install:
- gem install travis
- mkdir ${cmr_SAMPLE_DIR}
- mkdir ${cmr_SAMPLE_LIB_DIR}
- git clone https://github.com/LibCMaker/LibCMaker.git ${cmr_SAMPLE_LIB_DIR}/LibCMaker
script:
- cp ${cmr_SAMPLE_LIB_DIR}/LibCMaker/ci/travis/trigger.sh ${TRAVIS_BUILD_DIR}/
- cp ${cmr_SAMPLE_LIB_DIR}/LibCMaker/ci/travis/trigger-travis.sh ${TRAVIS_BUILD_DIR}/
- cd ${TRAVIS_BUILD_DIR}
# NOTE: LibCMaker lib triggers.
- ./trigger.sh LibCMaker LibCMaker_FontConfig master $TRAVIS_ACCESS_TOKEN
notifications:
email:
recipients:
on_success: always
on_failure: always