forked from KhronosGroup/Vulkan-ValidationLayers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
237 lines (230 loc) · 9.53 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
# Build Configuration for Travis CI
# https://travis-ci.org
dist: xenial
sudo: required
language: cpp
matrix:
# Show final status immediately if a test fails.
fast_finish: true
allow_failures:
- env: CHECK_COMMIT_FORMAT=ON
include:
# Android build.
- os: linux
compiler: gcc
env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-26 ANDROID_ABI=armeabi-v7a
# Android 64-bit build.
- os: linux
compiler: gcc
env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-26 ANDROID_ABI=arm64-v8a
# Linux GCC debug build.
- os: linux
compiler: gcc
env: VULKAN_BUILD_TARGET=LINUX
# Linux clang debug build.
- os: linux
compiler: clang
env: VULKAN_BUILD_TARGET=LINUX
# Linux GN debug build.
- os: linux
env: VULKAN_BUILD_TARGET=GN
# Check for proper clang formatting in the pull request.
- env: CHECK_FORMAT=ON
# Check for proper commit message formatting for commits in PR
- env: CHECK_COMMIT_FORMAT=ON
cache: ccache
# Use set -e so that the build fails when a command fails.
# The default action for Travis-CI is to continue running even if a command fails.
# See https://github.com/travis-ci/travis-ci/issues/1066.
# Use the YAML block scalar header (|) to allow easier multiline script coding.
before_install:
- set -e
- CMAKE_VERSION=3.10.2
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
# Upgrade to the desired version of CMake
CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
echo CMAKE_URL=${CMAKE_URL}
mkdir cmake-${CMAKE_VERSION} && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake-${CMAKE_VERSION}
export PATH=${PWD}/cmake-${CMAKE_VERSION}/bin:${PATH}
else
brew install cmake || brew upgrade cmake
fi
cmake --version
- |
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]] || [[ "$VULKAN_BUILD_TARGET" == "GN" ]]; then
# Install the appropriate Linux packages.
sudo apt-get -qq update
sudo apt-get -y install libxkbcommon-dev libwayland-dev libmirclient-dev libxrandr-dev \
libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-ewmh-dev \
libxcb-randr0-dev python-pathlib
fi
- |
if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
# Install the Android NDK.
export ARCH=`uname -m`
wget http://dl.google.com/android/repository/android-ndk-r18b-linux-${ARCH}.zip
unzip -u -q android-ndk-r18b-linux-${ARCH}.zip
export ANDROID_NDK_HOME=`pwd`/android-ndk-r18b
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
export PATH="$ANDROID_NDK_HOME:$PATH"
fi
- |
if [[ "$CHECK_FORMAT" == "ON" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then
# Install the clang format diff tool, but only for pull requests.
curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py \
-o scripts/clang-format-diff.py;
fi
# Misc setup
- export core_count=$(nproc || echo 4) && echo core_count = $core_count
- ccache --zero-stats
- set +e
script:
- set -e
- |
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
# Build Vulkan-Loader to run Vulkan-ValidationLayer tests
cd ${TRAVIS_BUILD_DIR}/external
git clone https://github.com/KhronosGroup/Vulkan-Loader.git
cd Vulkan-Loader
python scripts/update_deps.py --dir=external
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -C../external/helper.cmake -DCMAKE_INSTALL_PREFIX=install ..
cmake --build . --target install -- -j$core_count
cd ${TRAVIS_BUILD_DIR}
# Build all remaining dependencies for Vulkan-ValidationLayers
if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then
# Build master branch when triggered by (daily) cron job
${TRAVIS_BUILD_DIR}/scripts/update_deps.py --dir=${TRAVIS_BUILD_DIR}/external --ref=master
else
${TRAVIS_BUILD_DIR}/scripts/update_deps.py --dir=${TRAVIS_BUILD_DIR}/external
fi
fi
- |
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
# Fetch googletest component to build validation layer tests
echo Fetching googletest external dependencies for building validation layer tests
git clone https://github.com/google/googletest.git ${TRAVIS_BUILD_DIR}/external/googletest
pushd ${TRAVIS_BUILD_DIR}/external/googletest
git checkout tags/release-1.8.1
popd
fi
- |
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
# Verify consistency between source file generators and output
echo Verifying consistency between source file generators and output
python3 ${TRAVIS_BUILD_DIR}/scripts/generate_source.py --verify ${TRAVIS_BUILD_DIR}/external/Vulkan-Headers/registry
fi
- |
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
# Build Vulkan-ValidationLayers
cd ${TRAVIS_BUILD_DIR}
mkdir build
cd build
cmake -C ${TRAVIS_BUILD_DIR}/external/helper.cmake -DCMAKE_BUILD_TYPE=Debug \
-DVULKAN_LOADER_INSTALL_DIR=${TRAVIS_BUILD_DIR}/external/Vulkan-Loader/build/install \
-DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/build/install -DBUILD_LAYER_SUPPORT_FILES=ON \
-DUSE_CCACHE=ON ..
cmake --build . --target install -- -j$core_count
fi
- |
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
# Build DevSim in VulkanTools to run Vulkan-ValidationLayer tests
cd ${TRAVIS_BUILD_DIR}/external
git clone https://github.com/LunarG/VulkanTools.git
cd VulkanTools
./update_external_sources.sh
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug \
-DBUILD_VIA=NO -DBUILD_VKTRACE=NO -DBUILD_VLF=NO -DBUILD_TESTS=NO -DBUILD_LAYERMGR=NO \
-DBUILD_MONITOR=NO -DBUILD_SCREENSHOT=NO -DBUILD_APIDUMP=NO \
-DBUILD_VKTRACEVIEWER=NO -DBUILD_VKTRACE_LAYER=NO -DBUILD_VKTRACE_REPLAY=NO \
-DVULKAN_HEADERS_INSTALL_DIR=${TRAVIS_BUILD_DIR}/external/Vulkan-Headers/build/install \
-DVULKAN_LOADER_INSTALL_DIR=${TRAVIS_BUILD_DIR}/external/Vulkan-Loader/build/install \
-DVULKAN_VALIDATIONLAYERS_INSTALL_DIR=${TRAVIS_BUILD_DIR}/build/install \
..
cmake --build . --target VkLayer_device_simulation -- -j $core_count
fi
- |
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
# Build MockICD in Vulkan-Tools to run Vulkan-ValidationLayer tests
cd ${TRAVIS_BUILD_DIR}/external
git clone https://github.com/KhronosGroup/Vulkan-Tools.git
cd Vulkan-Tools
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug \
-DBUILD_CUBE=NO -DBUILD_VULKANINFO=NO -DINSTALL_ICD=OFF \
-DVULKAN_HEADERS_INSTALL_DIR=${TRAVIS_BUILD_DIR}/external/Vulkan-Headers/build/install \
..
pushd ../icd/generated
VVL_REG_DIR=${TRAVIS_BUILD_DIR}/external/Vulkan-Headers/registry
VT_SCRIPTS_DIR=${TRAVIS_BUILD_DIR}/external/Vulkan-Tools/scripts
python3 ${TRAVIS_BUILD_DIR}/scripts/lvl_genvk.py -registry ${VVL_REG_DIR}/vk.xml vk_typemap_helper.h
python3 ${VT_SCRIPTS_DIR}/kvt_genvk.py -registry ${VVL_REG_DIR}/vk.xml mock_icd.cpp
python3 ${VT_SCRIPTS_DIR}/kvt_genvk.py -registry ${VVL_REG_DIR}/vk.xml mock_icd.h
popd
cmake --build . --target VkICD_mock_icd -- -j $core_count
cp ../icd/linux/VkICD_mock_icd.json icd
fi
- |
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
# Run Tests
cd ${TRAVIS_BUILD_DIR}
export LD_LIBRARY_PATH=${TRAVIS_BUILD_DIR}/external/Vulkan-Loader/build/install/lib:${LD_LIBRARY_PATH}
export VK_LAYER_PATH=${TRAVIS_BUILD_DIR}/external/VulkanTools/build/layersvt:${TRAVIS_BUILD_DIR}/build/layers
export VK_ICD_FILENAMES=${TRAVIS_BUILD_DIR}/external/Vulkan-Tools/build/icd/VkICD_mock_icd.json
build/tests/vk_layer_validation_tests
for profile in tests/device_profiles/*.json
do
echo Testing with profile $profile
VK_DEVSIM_FILENAME=$profile build/tests/vk_layer_validation_tests --devsim
done
fi
- |
if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
pushd build-android
./update_external_sources_android.sh --abi $ANDROID_ABI --no-build
USE_CCACHE=1 NDK_CCACHE=ccache ndk-build APP_ABI=$ANDROID_ABI -j $core_count
popd
fi
- |
if [[ "$CHECK_FORMAT" == "ON" ]]; then
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
# Run the clang format check only for pull request builds because the
# master branch is needed to do the git diff.
echo "Checking clang-format between TRAVIS_BRANCH=$TRAVIS_BRANCH and TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH"
./scripts/check_code_format.sh
else
echo "Skipping clang-format check since this is not a pull request."
fi
fi
- |
if [[ "$CHECK_COMMIT_FORMAT" == "ON" ]]; then
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
echo "Checking commit message formats: See CONTRIBUTING.md"
./scripts/check_commit_message_format.sh
fi
fi
- |
if [[ "$VULKAN_BUILD_TARGET" == "GN" ]]; then
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot_tools
export PATH=$PATH:$PWD/depot_tools
./build-gn/update_deps.sh
gn gen out/Debug
ninja -C out/Debug
fi
- ccache --show-stats
- set +e
notifications:
email:
recipients:
on_success: change
on_failure: always