1 # Build Configuration for Travis CI
2 # https://travis-ci.org
8 # This line necessary for allow_failures operation
12 # Show final status immediately if a test fails.
15 - env: CHECK_COMMIT_FORMAT=ON
20 env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a
21 # Android 64-bit build.
24 env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=arm64-v8a
25 # Linux GCC debug build.
28 env: VULKAN_BUILD_TARGET=LINUX
29 # Linux clang debug build.
32 env: VULKAN_BUILD_TARGET=LINUX
33 # Check for proper clang formatting in the pull request.
34 - env: CHECK_FORMAT=ON
35 # Check for proper commit message formatting for commits in PR
36 - env: CHECK_COMMIT_FORMAT=ON
40 # Use set -e so that the build fails when a command fails.
41 # The default action for Travis-CI is to continue running even if a command fails.
42 # See https://github.com/travis-ci/travis-ci/issues/1066.
43 # Use the YAML block scalar header (|) to allow easier multiline script coding.
48 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
49 # Install the appropriate Linux packages.
50 sudo apt-get -qq update
51 sudo apt-get -y install libxkbcommon-dev libwayland-dev libmirclient-dev libxrandr-dev libx11-xcb-dev
54 if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
55 # Install the Android NDK.
56 export ARCH=`uname -m`
57 wget http://dl.google.com/android/repository/android-ndk-r15c-linux-${ARCH}.zip
58 unzip -u -q android-ndk-r15c-linux-${ARCH}.zip
59 export ANDROID_NDK_HOME=`pwd`/android-ndk-r15c
60 export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
61 export PATH="$ANDROID_NDK_HOME:$PATH"
64 if [[ "$CHECK_FORMAT" == "ON" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then
65 # Install the clang format diff tool, but only for pull requests.
66 curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py -o scripts/clang-format-diff.py;
70 - export core_count=$(nproc || echo 4) && echo core_count = $core_count
76 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
77 # Get VulkanTools and build DevSim
80 git clone https://github.com/LunarG/VulkanTools.git
82 # Get as little as possible from external sources
83 ./update_external_sources.sh --glslang --no-build
84 # Build as few components as possible
85 cmake -H. -Bbuild -DBUILD_LOADER=NO -DBUILD_TESTS=NO \
86 -DBUILD_LAYERS=NO -DBUILD_DEMOS=NO -DBUILD_VKTRACE=NO \
87 -DBUILD_VKJSON=NO -DBUILD_VIA=NO -DBUILD_ICD=NO
88 make -C build -j $core_count
89 cd ${TRAVIS_BUILD_DIR}
92 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
94 ./update_external_sources.sh
95 cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug
96 make -C dbuild -j $core_count
99 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
101 (cd dbuild/tests; ./vkvalidatelayerdoc.sh)
102 export LD_LIBRARY_PATH=dbuild/loader:$LD_LIBRARY_PATH
103 export VK_LAYER_PATH=external/VulkanTools/build/layersvt:dbuild/layers
104 export VK_ICD_FILENAMES=dbuild/icd/VkICD_mock_icd.json
105 dbuild/tests/vk_layer_validation_tests
106 for profile in tests/device_profiles/*.json
108 echo Testing with profile $profile
109 VK_DEVSIM_FILENAME=$profile dbuild/tests/vk_layer_validation_tests --devsim
113 if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
115 ./update_external_sources_android.sh --abi $ANDROID_ABI --no-build
116 ./android-generate.sh
117 USE_CCACHE=1 NDK_CCACHE=ccache ndk-build APP_ABI=$ANDROID_ABI -j $core_count
121 if [[ "$CHECK_FORMAT" == "ON" ]]; then
122 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
123 # Run the clang format check only for pull request builds because the
124 # master branch is needed to do the git diff.
125 echo "Checking clang-format between TRAVIS_BRANCH=$TRAVIS_BRANCH and TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH"
126 ./scripts/check_code_format.sh
128 echo "Skipping clang-format check since this is not a pull request."
132 if [[ "$CHECK_COMMIT_FORMAT" == "ON" ]]; then
133 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
134 echo "Checking commit message formats: See CONTRIBUTING.md"
135 ./scripts/check_commit_message_format.sh
144 - cnorthrop@google.com
146 - chrisforbes@google.com