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
13 - env: VULKAN_BUILD_TARGET=GN
18 env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a
19 # Android 64-bit build.
22 env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=arm64-v8a
23 # Linux GCC debug build.
26 env: VULKAN_BUILD_TARGET=LINUX
27 # Linux clang debug build.
30 env: VULKAN_BUILD_TARGET=LINUX
31 # Linux GN debug build
33 env: VULKAN_BUILD_TARGET=GN
34 # Check for proper clang formatting in the pull request.
35 - env: CHECK_FORMAT=ON
36 # Check for proper commit message formatting for commits in PR
37 - env: CHECK_COMMIT_FORMAT=ON
41 # Use set -e so that the build fails when a command fails.
42 # The default action for Travis-CI is to continue running even if a command fails.
43 # See https://github.com/travis-ci/travis-ci/issues/1066.
44 # Use the YAML block scalar header (|) to allow easier multiline script coding.
48 - CMAKE_VERSION=3.10.2
50 if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
51 CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
52 echo CMAKE_URL=${CMAKE_URL}
53 mkdir cmake-${CMAKE_VERSION} && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake-${CMAKE_VERSION}
54 export PATH=${PWD}/cmake-${CMAKE_VERSION}/bin:${PATH}
56 brew install cmake || brew upgrade cmake
60 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]] || [[ "$VULKAN_BUILD_TARGET" == "GN" ]]; then
61 # Install the appropriate Linux packages.
62 sudo apt-get -qq update
63 sudo apt-get -y install libxkbcommon-dev libwayland-dev libmirclient-dev libxrandr-dev libx11-xcb-dev python-pathlib
66 if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
67 # Install the Android NDK.
68 export ARCH=`uname -m`
69 wget http://dl.google.com/android/repository/android-ndk-r15c-linux-${ARCH}.zip
70 unzip -u -q android-ndk-r15c-linux-${ARCH}.zip
71 export ANDROID_NDK_HOME=`pwd`/android-ndk-r15c
72 export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
73 export PATH="$ANDROID_NDK_HOME:$PATH"
76 if [[ "$CHECK_FORMAT" == "ON" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then
77 # Install the clang format diff tool, but only for pull requests.
78 curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py -o scripts/clang-format-diff.py;
82 - export core_count=$(nproc || echo 4) && echo core_count = $core_count
88 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
90 cd ${TRAVIS_BUILD_DIR}
93 python ${TRAVIS_BUILD_DIR}/scripts/update_deps.py --config=Debug --dir=${TRAVIS_BUILD_DIR}/external
94 cmake -C${TRAVIS_BUILD_DIR}/external/helper.cmake -DCMAKE_BUILD_TYPE=Debug ..
96 cd ${TRAVIS_BUILD_DIR}
99 if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
100 # Run vulkaninfo as a test
101 cd ${TRAVIS_BUILD_DIR}
104 VK_ICD_FILENAMES=../icd/VkICD_mock_icd.json ./vulkaninfo
105 cd ${TRAVIS_BUILD_DIR}
108 if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
109 pushd ${TRAVIS_BUILD_DIR}/build-android
110 ./update_external_sources_android.sh --abi $ANDROID_ABI --no-build
112 pushd ${TRAVIS_BUILD_DIR}/cube/android
113 USE_CCACHE=1 NDK_CCACHE=ccache ndk-build APP_ABI=$ANDROID_ABI -j $core_count
117 if [[ "$VULKAN_BUILD_TARGET" == "GN" ]]; then
118 git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot_tools
119 export PATH=$PATH:$PWD/depot_tools
120 ./build-gn/update_deps.sh
125 if [[ "$CHECK_FORMAT" == "ON" ]]; then
126 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
127 # Run the clang format check only for pull request builds because the
128 # master branch is needed to do the git diff.
129 echo "Checking clang-format between TRAVIS_BRANCH=$TRAVIS_BRANCH and TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH"
130 ./scripts/check_code_format.sh
132 echo "Skipping clang-format check since this is not a pull request."
136 if [[ "$CHECK_COMMIT_FORMAT" == "ON" ]]; then
137 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
138 echo "Checking commit message formats: See CONTRIBUTING.md"
139 ./scripts/check_commit_message_format.sh
147 - cnorthrop@google.com
149 - chrisforbes@google.com