loader:Fix build warnings
[platform/upstream/Vulkan-LoaderAndValidationLayers.git] / .travis.yml
1 # Build Configuration for Travis CI
2 # https://travis-ci.org
3
4 dist: trusty
5 sudo: required
6 language: cpp
7
8 matrix:
9   # Show final status immediately if a test fails.
10   fast_finish: true
11   allow_failures:
12     - env: CHECK_COMMIT_FORMAT=ON
13   include:
14     # Android build.
15     - os: linux
16       compiler: gcc
17       env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a
18     # Android 64-bit build.
19     - os: linux
20       compiler: gcc
21       env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=arm64-v8a
22     # Linux GCC debug build.
23     - os: linux
24       compiler: gcc
25       env: VULKAN_BUILD_TARGET=LINUX
26     # Linux clang debug build.
27     - os: linux
28       compiler: clang
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
34
35 cache: ccache
36
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.
41
42 before_install:
43   - set -e
44   - |
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     fi
50   - |
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"
59     fi
60   - |
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;
64     fi
65   # Misc setup
66   - |
67   - export core_count=$(nproc || echo 4) && echo core_count = $core_count
68   - set +e
69
70 script:
71   - set -e
72   - |
73     if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
74       # Get VulkanTools and build DevSim
75       mkdir -p external
76       cd external
77       git clone https://github.com/LunarG/VulkanTools.git
78       cd VulkanTools
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}
87     fi
88   - |
89     if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
90       # Build LVL
91       ./update_external_sources.sh
92       cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug
93       make -C dbuild -j $core_count
94     fi
95   - |
96     if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
97       # Run Tests
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
104       do
105         echo Testing with profile $profile
106         VK_DEVSIM_FILENAME=$profile dbuild/tests/vk_layer_validation_tests --devsim
107       done
108     fi
109   - |
110     if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
111       pushd build-android
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
115       popd
116     fi
117   - |
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
124       else
125         echo "Skipping clang-format check since this is not a pull request."
126       fi
127     fi
128   - |
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
133       fi
134     fi
135   - set +e
136
137 notifications:
138   email:
139     recipients:
140       - karl@lunarg.com
141       - cnorthrop@google.com
142       - tobine@google.com
143       - chrisforbes@google.com
144     on_success: change
145     on_failure: always