1 # Build Configuration for Travis CI
2 # https://travis-ci.org
9 # Show final status immediately if a test fails.
12 - env: CHECK_COMMIT_FORMAT=ON
17 env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a
18 # Android 64-bit build.
21 env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=arm64-v8a
22 # Linux GCC debug build.
25 env: VULKAN_BUILD_TARGET=LINUX
26 # Linux clang debug build.
29 env: VULKAN_BUILD_TARGET=LINUX
30 # Check for proper clang formatting in the pull request.
31 - env: CHECK_FORMAT=ON
32 # Check for proper commit message formatting for commits in PR
33 - env: CHECK_COMMIT_FORMAT=ON
37 # Use set -e so that the build fails when a command fails.
38 # The default action for Travis-CI is to continue running even if a command fails.
39 # See https://github.com/travis-ci/travis-ci/issues/1066.
40 # Use the YAML block scalar header (|) to allow easier multiline script coding.
45 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
46 # Install the appropriate Linux packages.
47 sudo apt-get -qq update
48 sudo apt-get -y install libxkbcommon-dev libwayland-dev libmirclient-dev libxrandr-dev libx11-xcb-dev
51 if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
52 # Install the Android NDK.
53 export ARCH=`uname -m`
54 wget http://dl.google.com/android/repository/android-ndk-r15c-linux-${ARCH}.zip
55 unzip -u -q android-ndk-r15c-linux-${ARCH}.zip
56 export ANDROID_NDK_HOME=`pwd`/android-ndk-r15c
57 export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
58 export PATH="$ANDROID_NDK_HOME:$PATH"
61 if [[ "$CHECK_FORMAT" == "ON" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then
62 # Install the clang format diff tool, but only for pull requests.
63 curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py -o scripts/clang-format-diff.py;
67 - export core_count=$(nproc || echo 4) && echo core_count = $core_count
73 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
74 # Get VulkanTools and build DevSim
77 git clone https://github.com/LunarG/VulkanTools.git
79 # Get as little as possible from external sources
80 ./update_external_sources.sh --glslang --no-build
81 # Build as few components as possible
82 cmake -H. -Bbuild -DBUILD_LOADER=NO -DBUILD_TESTS=NO \
83 -DBUILD_LAYERS=NO -DBUILD_DEMOS=NO -DBUILD_VKTRACE=NO \
84 -DBUILD_VKJSON=NO -DBUILD_VIA=NO -DBUILD_ICD=NO
85 make -C build -j $core_count
86 cd ${TRAVIS_BUILD_DIR}
89 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
91 ./update_external_sources.sh
92 cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug
93 make -C dbuild -j $core_count
96 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
98 (cd dbuild/tests; ./vkvalidatelayerdoc.sh)
99 export LD_LIBRARY_PATH=dbuild/loader:$LD_LIBRARY_PATH
100 export VK_LAYER_PATH=external/VulkanTools/build/layersvt:dbuild/layers
101 export VK_ICD_FILENAMES=dbuild/icd/VkICD_mock_icd.json
102 dbuild/tests/vk_layer_validation_tests
103 for profile in tests/device_profiles/*.json
105 echo Testing with profile $profile
106 VK_DEVSIM_FILENAME=$profile dbuild/tests/vk_layer_validation_tests --devsim
110 if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
112 ./update_external_sources_android.sh --abi $ANDROID_ABI --no-build
113 ./android-generate.sh
114 USE_CCACHE=1 NDK_CCACHE=ccache ndk-build APP_ABI=$ANDROID_ABI -j $core_count
118 if [[ "$CHECK_FORMAT" == "ON" ]]; then
119 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
120 # Run the clang format check only for pull request builds because the
121 # master branch is needed to do the git diff.
122 echo "Checking clang-format between TRAVIS_BRANCH=$TRAVIS_BRANCH and TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH"
123 ./scripts/check_code_format.sh
125 echo "Skipping clang-format check since this is not a pull request."
129 if [[ "$CHECK_COMMIT_FORMAT" == "ON" ]]; then
130 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
131 echo "Checking commit message formats: See CONTRIBUTING.md"
132 ./scripts/check_commit_message_format.sh
141 - cnorthrop@google.com
143 - chrisforbes@google.com