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
49 # Get a prebuilt shader compiler (glslangValidator) so that we don't have to build all of glslang
52 wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip
53 unzip -u -q glslang-master-linux-Release.zip
55 export PATH=${TRAVIS_BUILD_DIR}/glslang/bin:$PATH
56 glslangValidator --version
59 if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
60 # Install the Android NDK.
61 export ARCH=`uname -m`
62 wget http://dl.google.com/android/repository/android-ndk-r15c-linux-${ARCH}.zip
63 unzip -u -q android-ndk-r15c-linux-${ARCH}.zip
64 export ANDROID_NDK_HOME=`pwd`/android-ndk-r15c
65 export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
66 export PATH="$ANDROID_NDK_HOME:$PATH"
69 if [[ "$CHECK_FORMAT" == "ON" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then
70 # Install the clang format diff tool, but only for pull requests.
71 curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py -o scripts/clang-format-diff.py;
75 - export core_count=$(nproc || echo 4) && echo core_count = $core_count
81 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
82 # Build Vulkan-Loader for Vulkan-Tools
83 cd ${TRAVIS_BUILD_DIR}
84 git clone --recurse-submodules https://github.com/KhronosGroup/Vulkan-Loader.git
88 cmake -DCMAKE_BUILD_TYPE=Debug ..
90 cd ${TRAVIS_BUILD_DIR}
93 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
95 cd ${TRAVIS_BUILD_DIR}
98 cmake -DLOADER_REPO_ROOT=${TRAVIS_BUILD_DIR}/Vulkan-Loader -DCMAKE_BUILD_TYPE=Debug ..
100 cd ${TRAVIS_BUILD_DIR}
103 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
104 # Run vulkaninfo as a test
105 cd ${TRAVIS_BUILD_DIR}
108 VK_ICD_FILENAMES=../icd/VkICD_mock_icd.json ./vulkaninfo
109 cd ${TRAVIS_BUILD_DIR}
112 if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
114 ./update_external_sources_android.sh --abi $ANDROID_ABI --no-build
115 ./android-generate.sh
116 USE_CCACHE=1 NDK_CCACHE=ccache ndk-build APP_ABI=$ANDROID_ABI -j $core_count
120 if [[ "$CHECK_FORMAT" == "ON" ]]; then
121 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
122 # Run the clang format check only for pull request builds because the
123 # master branch is needed to do the git diff.
124 echo "Checking clang-format between TRAVIS_BRANCH=$TRAVIS_BRANCH and TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH"
125 ./scripts/check_code_format.sh
127 echo "Skipping clang-format check since this is not a pull request."
131 if [[ "$CHECK_COMMIT_FORMAT" == "ON" ]]; then
132 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
133 echo "Checking commit message formats: See CONTRIBUTING.md"
134 ./scripts/check_commit_message_format.sh
143 - cnorthrop@google.com
145 - chrisforbes@google.com