-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
220 lines (212 loc) · 6.98 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
# ---------------------------------------------------------------------------
#
# Author
# Reference
# - https://docs.travis-ci.com/user/languages/cpp/
# - https://libcxx.llvm.org/docs/BuildingLibcxx.html
# - http://rkh.github.io/travis-encrypt/public/index.html
# - http://rkh.github.io/travis-encrypt/public/index.html
#
# ---------------------------------------------------------------------------
sudo: false
git:
submodules: false
depth: 1
notifications:
email:
language: cpp
compiler: clang
matrix:
include:
# Linux : x86_64 Debug Dynamic
- os: linux
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- llvm-5.0
- clang-5.0
- libc++-dev
- libc++1
- libc++-dev
- libc++abi1
- libc++abi-dev
- ninja-build
- tree
env:
- PLATFORM=linux
- CONFIG=Debug
- BUILD_SHARED=true
before_install:
- uname;
- echo $TRAVIS_OS_NAME;
# Prepare SonarQube
# - wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.3.zip
# - unzip -q sonarqube-7.3.zip
# # Sonar Scanner
# - export ROOT_DIR=`pwd`; echo $ROOT_DIR;
# - wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.2.0.1227-linux.zip > /dev/null 2>&1
# - unzip -q sonar-scanner-cli-3.2.0.1227-linux.zip
# - export PATH=$ROOT_DIR/sonar-scanner-3.2.0.1227-linux/bin/:$PATH
# - sonar-scanner -v
# # Sonar C/C++ Family Build Wrapper
# - wget https://sonarsource.bintray.com/CommercialDistribution/sonar-cpp-plugin/build-wrapper-3.11.zip > /dev/null 2>&1
# - unzip -q build-wrapper-3.11.zip
# - export PATH=$ROOT_DIR/build-wrapper-3.11/linux-x86-64:$PATH
# - build-wrapper-linux-x86-64 -h || true
install:
# Download llvm/libc++ via Github submodule
# This is a little bit slower than svn
- git submodule update --init llvm libcxx libcxxabi;
# Build libcxx
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
mkdir -p prebuilt && pushd prebuilt;
cmake ../libcxx -DLLVM_PATH=../llvm -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_CXX_ABI_INCLUDE_PATHS=../libcxxabi/include -DCMAKE_INSTALL_PREFIX=. -DCMAKE_BUILD_TYPE=Release ;
make -j10 install;
rm CMakeCache.txt;
tree ./include;
popd;
fi
# Build libcxxabi
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
mkdir -p prebuilt && pushd prebuilt;
cmake ../libcxxabi -DLLVM_PATH=../llvm/ -DLIBCXXABI_LIBCXX_PATH=../libcxx/ -DCMAKE_INSTALL_PREFIX=../prebuilt/ ;
make -j10 install;
rm CMakeCache.txt;
tree ./lib;
popd;
fi
before_script:
- cd ${TRAVIS_BUILD_DIR}
- mkdir -p build && pushd build; # Create & Move to build directory
script:
- cmake ../
-G "Ninja"
-DBUILD_SHARED_LIBS=$BUILD_SHARED
-DCMAKE_BUILD_TYPE=$CONFIG
-DCMAKE_INSTALL_PREFIX=../install
# - build-wrapper-linux-x86-64 --out-dir bw-output ninja
- ninja install
- ./cppmagic_test --reporter compact # run tests
after_success:
- tree -f ./CMakeFiles/
# Get .gcda to extract .gcov
- cp ./CMakeFiles/cppmagic_test.dir/test/test.entry.cpp.* ./ ;
# Generate .gcov files
- llvm-cov-5.0 gcov -abcf ./test.entry.cpp.gcda > log-llvm-cov.txt
- popd;
- tree ./install
# Upload to sonarcloud. Use `sonar-project.properties`
# - sonar-scanner -X --define sonar.login=$UPLOAD_TOKEN
# OS X : x86_64 Debug Dynamic
- os: osx
osx_image: xcode9.4
addons:
homebrew:
update: true
packages:
- ninja
- tree
- llvm
env:
- PLATFORM=osx
- CONFIG=Debug
- BUILD_SHARED=true
before_install:
- uname;
- echo $TRAVIS_OS_NAME;
install:
- brew info llvm; # Check llvm version
before_script:
- cd ${TRAVIS_BUILD_DIR}
- mkdir -p build && pushd build; # Create & Move to build directory
script:
- cmake ../
-G "Ninja"
-DBUILD_SHARED_LIBS=$BUILD_SHARED
-DCMAKE_BUILD_TYPE=$CONFIG
-DCMAKE_INSTALL_PREFIX=../install
- ninja install
# Display build results and start tests
- ./cppmagic_test
- tree -f ./CMakeFiles/
after_success:
# MacOS: Run coverage tool for Debug build
- cp ./CMakeFiles/cppmagic_test.dir/test/test.entry.cpp.* ./ ;
- gcov -abcf ./test.entry.cpp.gcda > log-gcov.txt;
- ls -al | grep .gcov;
- lcov --directory . --gcov-tool gcov --capture -o cov.info ;
- genhtml cov.info -o cov_report;
- tree ./cov_report;
# Display build results
- popd;
- tree ./install
# Android JNI: armeabi-v7a
- language: android
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- wget
- unzip
- tree
android:
components:
- tools
- platform-tools
- android-21
- sys-img-armeabi-v7a-android-21
install:
# Accept SDK Licenses + Install NDK
- yes | sdkmanager --update > /dev/null 2>&1
- sdkmanager ndk-bundle > /dev/null 2>&1
# Download Gradle
- wget https://services.gradle.org/distributions/gradle-4.10.2-bin.zip;
- unzip -q gradle-4.10.2-bin.zip;
- export GRADLE=./gradle-4.10.2/bin/gradle
before_script:
- bash $GRADLE --version
script:
- bash $GRADLE clean assemble
after_success:
- cd ${TRAVIS_BUILD_DIR}
- tree ./install
# iPhone OS 10.3 : armv7 armv7s arm64 Debug Dynamic
- os: osx
osx_image: xcode9.4
addons:
homebrew:
update: true
packages:
- ninja
- tree
- llvm
env:
- PLATFORM=iOS
- CONFIG=Debug
- BUILD_SHARED=true
install:
- brew info llvm;
- git submodule update --init ios-cmake;
before_script:
- cd ${TRAVIS_BUILD_DIR}
- mkdir -p build && pushd build; # Create & Move to build directory
script:
- cmake ../
-DBUILD_SHARED_LIBS=$BUILD_SHARED
-DCMAKE_BUILD_TYPE=$CONFIG
-DCMAKE_TOOLCHAIN_FILE=../ios-cmake/ios.toolchain.cmake
-DIOS_DEPLOYMENT_TARGET=10.3
-DENABLE_BITCODE=false
-DCMAKE_INSTALL_PREFIX=../install
- make -j10 install
- file libcppmagic.dylib
after_success:
- cd ${TRAVIS_BUILD_DIR}
- tree ./install