forked from fastbuild/fastbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
250 lines (246 loc) · 8.25 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
language: cpp
matrix:
include:
#=====================================================================
# Compile & Run Tests (Unity)
#=====================================================================
- os: linux
stage: Compile
name: "Linux: Debug/Profile/Release & Tests"
#---------------------------------------------------------------------
- os: osx
stage: Compile
name: "OSX: Debug/Profile/Release & Tests"
compiler: clang
#---------------------------------------------------------------------
- os: windows
stage: Compile
name: "Windows: Debug/Profile/Release & Tests"
#=====================================================================
# Compile Only (No Unity)
#=====================================================================
- os: linux
stage: Compile
name: "Linux: Debug (NoUnity)"
env: CFG=nounity
#---------------------------------------------------------------------
- os: osx
stage: Compile
name: "OSX: Debug (NoUnity)"
compiler: clang
env: CFG=nounity
#---------------------------------------------------------------------
- os: windows
stage: Compile
name: "Windows: Debug (NoUnity)"
env: CFG=nounity
#=====================================================================
# Static Analysis
#=====================================================================
- os: windows
stage: StaticAnalysis
name: "Windows Analyze"
env: CFG=analyze
#=====================================================================
# Linux, Latest supported compilers
#=====================================================================
#- os: linux
# stage: Other
# name: "Linux GCC8 & Clang8"
# env: GCC=gcc-8 CLANG=clang-8
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-trusty-8
# packages:
# - gcc-8
# - g++-8
# - clang-8
#=====================================================================
# Sanitizers
#=====================================================================
# Linux, AddressSanitizer
#---------------------------------------------------------------------
- os: linux
stage: Sanitizers
name: "Linux AddressSanitizer"
env: CFG=asan CLANG=clang-8
# Use latest clang when building with sanitizers.
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-8
packages:
- clang-8
- llvm-8 # for llvm-symbolizer
sudo: true # LeakSanitizer doesn't work inside Travis containers, see https://github.com/travis-ci/travis-ci/issues/9033.
#---------------------------------------------------------------------
# Linux, MemorySanitizer
#---------------------------------------------------------------------
- os: linux
stage: Sanitizers
name: "Linux MemorySanitizer"
env: CFG=msan CLANG=clang-8
# Use latest clang when building with sanitizers.
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-8
packages:
- clang-8
- llvm-8 # for llvm-symbolizer
#---------------------------------------------------------------------
# Linux, ThreadSanitizer
#---------------------------------------------------------------------
- os: linux
stage: Sanitizers
name: "Linux ThreadSanitizer"
env: CFG=tsan CLANG=clang-8
# Use latest clang when building with sanitizers.
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-8
packages:
- clang-8
- llvm-8 # for llvm-symbolizer
allow_failures:
- env: CFG=asan CLANG=clang-8
- env: CFG=msan CLANG=clang-8
- env: CFG=tsan CLANG=clang-8
fast_finish: true
stages:
- Compile
- StaticAnalysis
- Sanitizers
#- Other
install:
# Download and unpack archive for a release version.
- DL_VER=1.03
- |
case "${TRAVIS_OS_NAME}" in
linux) FN=FASTBuild-Linux-x64-v${DL_VER}.zip FBUILD=fbuild ;;
osx) FN=FASTBuild-OSX-x64-v${DL_VER}.zip FBUILD=FBuild ;;
windows) FN=FASTBuild-Windows-x64-v${DL_VER}.zip FBUILD=FBuild.exe ;;
esac
# TODO: Remove --no-check-certificate when Travis CI fixes their Linux nodes
# (they currently incorrectly complain about an expired certificate for fastbuild.org)
# (works fine outside of Travis, and even on OSX and Windows nodes in Travis)
- wget --no-check-certificate https://fastbuild.org/downloads/v${DL_VER}/${FN}
- unzip ${FN}
- chmod +x ./${FBUILD}
# Set up some variables for convenience.
- |
- FBUILD_CMD="../${FBUILD} -noprogress -nostoponerror -summary"
- GCC=${GCC:-gcc}
- GXX=${GCC/gcc/g++}
- CLANG=${CLANG:-clang}
- CLANGXX=${CLANG/clang/clang++}
# On Linux/OSX print paths to binaries for the installed compilers.
# On Windows check that all tools are present at paths we expect, if not then try to find them on the disk and fail the build.
- |
case "${TRAVIS_OS_NAME}" in
linux)
for x in ${GCC} ${GXX} $(${GCC} -print-prog-name=cc1) $(${GCC} -print-prog-name=cc1plus) ${CLANG} ${CLANGXX}; do
echo $x; which $x && readlink -f $(which $x)
echo
done
true # These commands are purely informational, don't fail the build if they fail.
;;
osx)
for x in ${CLANG} ${CLANGXX}; do
echo $x; which $x
echo
done
true # These commands are purely informational, don't fail the build if they fail.
;;
windows)
SUCCESS=true
if [[ ! -f 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe' ]]; then
find 'C:\Program Files (x86)' 'C:\Program Files' -iname cl.exe
SUCCESS=false
fi
if [[ ! -f 'C:\Program Files (x86)\Windows Kits\10\Bin\10.0.17134.0\x64\RC.exe' ]]; then
find 'C:\Program Files (x86)' 'C:\Program Files' -iname rc.exe
SUCCESS=false
fi
if [[ ! -f 'C:\Program Files\LLVM\bin\clang++.exe' ]]; then
find 'C:\Program Files' -iname clang++.exe
SUCCESS=false
fi
if [[ ! -f 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe' ]]; then
find 'C:\Windows' -iname csc.exe
SUCCESS=false
fi
${SUCCESS}
;;
esac
script:
- cd Code
# Inject a #define into root configs to activate CI logic.
- |
sed -i -e "1i\\
#define CI_BUILD
" fbuild.bff Tools/FBuild/FBuildTest/Data/testcommon.bff
# Put full paths to GCC binaries into config files.
- |
case "${TRAVIS_OS_NAME}" in
linux)
sed -i -e "
s:GCC_BINARY:$(which ${GCC}):
s:GXX_BINARY:$(which ${GXX}):
s:CC1_BINARY:$(${GCC} -print-prog-name=cc1):
s:CC1PLUS_BINARY:$(${GCC} -print-prog-name=cc1plus):
" ../External/SDK/GCC/Linux/GCC_CI.bff
;;
esac
# Put full paths to Clang binaries into config files.
- |
case "${TRAVIS_OS_NAME}" in
linux|osx)
sed -i -e "
s:CLANG_BINARY:$(which ${CLANG}):
s:CLANGXX_BINARY:$(which ${CLANGXX}):
" ../External/SDK/Clang/{Linux,OSX}/Clang_CI.bff
;;
esac
# Run tests in the selected configuration.
- |
case "${TRAVIS_OS_NAME}:${CFG}" in
linux:|osx:|windows:)
${FBUILD_CMD} Exes Tests
;;
linux:asan)
${FBUILD_CMD} {CoreTest,FBuildTest}-RunTest-x64ClangLinux-ASan
;;
linux:msan)
${FBUILD_CMD} {CoreTest,FBuildTest}-RunTest-x64ClangLinux-MSan
;;
linux:tsan)
${FBUILD_CMD} {CoreTest,FBuildTest}-RunTest-x64ClangLinux-TSan
;;
esac
# Check non-unity build.
- |
case "${TRAVIS_OS_NAME}:${CFG}" in
linux:nounity)
${FBUILD_CMD} -nounity -clean All-x64{,Clang}Linux-Debug
;;
osx:nounity)
${FBUILD_CMD} -nounity -clean All-x64OSX-Debug
;;
windows:nounity)
${FBUILD_CMD} -nounity -clean All-x64{,Clang}-Debug
;;
esac
# Static Analysis
- |
case "${TRAVIS_OS_NAME}:${CFG}" in
windows:analyze)
${FBUILD_CMD} All-x64-Analyze
;;
esac