forked from LunarG/VulkanTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
129 lines (122 loc) · 5.18 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
# Build Configuration for Travis CI
# https://travis-ci.org
dist: trusty
sudo: required
language: cpp
matrix:
# Show final status immediately if a test fails.
fast_finish: true
include:
# Android build.
- os: linux
compiler: gcc
env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a
# Android 64-bit build.
- os: linux
compiler: gcc
env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 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
# Check for proper clang formatting in the pull request.
- env: CHECK_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
# Install the appropriate Linux packages.
- |
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
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
# Needed for devsim test
sudo apt-get -y install jq
fi
# Install the Android NDK.
- |
if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
export ARCH=`uname -m`
wget http://dl.google.com/android/repository/android-ndk-r15c-linux-${ARCH}.zip
unzip -u -q android-ndk-r15c-linux-${ARCH}.zip
export ANDROID_NDK_HOME=`pwd`/android-ndk-r15c
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
export PATH="$ANDROID_NDK_HOME:$PATH"
fi
# Install the clang format diff tool, but only for pull requests.
- |
if [[ "$CHECK_FORMAT" == "ON" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then
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
- set +e
script:
- set -e
- |
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
# Build VulkanTools
./update_external_sources.sh
cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug
make -C dbuild -j $core_count
fi
- |
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
# Run Tests
LVL_BUILD=$TRAVIS_BUILD_DIR/dbuild/submodules/Vulkan-LoaderAndValidationLayers
LVL_PROFILES=$TRAVIS_BUILD_DIR/submodules/Vulkan-LoaderAndValidationLayers/tests/device_profiles
export LD_LIBRARY_PATH=$LVL_BUILD/loader:$LD_LIBRARY_PATH
export VK_LAYER_PATH=$LVL_BUILD/layers:$TRAVIS_BUILD_DIR/dbuild/layersvt
export VK_ICD_FILENAMES=$LVL_BUILD/icd/VkICD_mock_icd.json
# Run vlf_test with mock ICD to ensure layer factory is working
dbuild/tests/vlf_test.sh
# Run apidump_test with mock ICD to ensure apidump layer is working
dbuild/tests/apidump_test.sh
# Run devsim tests with mock ICD to ensure devsim is working
dbuild/tests/devsim_layer_test.sh
# Run validation layer tests with mock ICD, some with devsim.
# These tests are redundant with LVL testing, but there is still some value with running them again here.
$LVL_BUILD/tests/vk_layer_validation_tests
VK_DEVSIM_FILENAME=$LVL_PROFILES/adreno_540.json $LVL_BUILD/tests/vk_layer_validation_tests --devsim
VK_DEVSIM_FILENAME=$LVL_PROFILES/amd_radv_polaris10.json $LVL_BUILD/tests/vk_layer_validation_tests --devsim
VK_DEVSIM_FILENAME=$LVL_PROFILES/geforce_940m.json $LVL_BUILD/tests/vk_layer_validation_tests --devsim
VK_DEVSIM_FILENAME=$LVL_PROFILES/intel_hd_graphics_520_skylake_gt2.json $LVL_BUILD/tests/vk_layer_validation_tests --devsim
VK_DEVSIM_FILENAME=$LVL_PROFILES/mali-t760.json $LVL_BUILD/tests/vk_layer_validation_tests --devsim
VK_DEVSIM_FILENAME=$LVL_PROFILES/nvidia_tegra_x1.json $LVL_BUILD/tests/vk_layer_validation_tests --devsim
VK_DEVSIM_FILENAME=$LVL_PROFILES/powervr_rogue_ge8300.json $LVL_BUILD/tests/vk_layer_validation_tests --devsim
fi
- |
if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
pushd build-android
./update_external_sources_android.sh --abi $ANDROID_ABI --no-build
./android-generate.sh
USE_CCACHE=1 NDK_CCACHE=ccache ndk-build APP_ABI=$ANDROID_ABI -j $core_count
popd
fi
# Run the clang format check only for pull request builds because the
# master branch is needed to do the git diff.
- |
if [[ "$CHECK_FORMAT" == "ON" ]]; then
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
echo "Checking clang-format between TRAVIS_BRANCH=$TRAVIS_BRANCH and TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH"
./submodules/Vulkan-LoaderAndValidationLayers/scripts/check_code_format.sh
else
echo "Skipping clang-format check since this is not a pull request."
fi
fi
- set +e
notifications:
email:
recipients:
- karl@lunarg.com
- cnorthrop@google.com
on_success: change
on_failure: always