mirror of
https://gitee.com/openharmony/third_party_vulkan-loader
synced 2024-11-23 07:10:23 +00:00
118 lines
3.8 KiB
YAML
118 lines
3.8 KiB
YAML
# Build Configuration for Travis CI
|
|
# https://travis-ci.org
|
|
|
|
dist: xenial
|
|
sudo: required
|
|
language: cpp
|
|
|
|
matrix:
|
|
# Show final status immediately if a test fails.
|
|
fast_finish: true
|
|
allow_failures:
|
|
- env: CHECK_COMMIT_FORMAT=ON
|
|
include:
|
|
# Linux GCC debug build.
|
|
- os: linux
|
|
compiler: gcc
|
|
env: VULKAN_BUILD_TARGET=LINUX
|
|
# Linux clang debug build.
|
|
- os: linux
|
|
compiler: clang
|
|
env: VULKAN_BUILD_TARGET=LINUX
|
|
# MacOS clang debug build.
|
|
- os: osx
|
|
compiler: clang
|
|
env: VULKAN_BUILD_TARGET=MACOS
|
|
# Check for proper clang formatting in the pull request.
|
|
- env: CHECK_FORMAT=ON
|
|
# Check for proper commit message formatting for commits in PR
|
|
- env: CHECK_COMMIT_FORMAT=ON
|
|
|
|
cache: ccache
|
|
|
|
# Use set -e so that the build fails when a command fails.
|
|
# Note that set +e must be called at the end or else failures may occur within Travis
|
|
# The default action for Travis-CI is to continue running even if a command fails.
|
|
# See https://github.com/travis-ci/travis-ci/issues/1066.
|
|
# Use the YAML block scalar header (|) to allow easier multiline script coding.
|
|
|
|
before_install:
|
|
- set -e
|
|
- unset -f cd pushd popd
|
|
- |
|
|
if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then
|
|
# Add an option to update dependencies from master
|
|
UPDATE_DEPS_EXTRA_OPTIONS="--ref=master"
|
|
fi
|
|
- |
|
|
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
|
|
# Install the appropriate Linux packages.
|
|
sudo apt-get -qq update
|
|
sudo apt-get -y install libxkbcommon-dev libwayland-dev libxrandr-dev libx11-xcb-dev
|
|
fi
|
|
- |
|
|
if [[ "$VULKAN_BUILD_TARGET" == "MACOS" ]]; then
|
|
# We need to upgrade to a newer python
|
|
brew upgrade python3
|
|
fi
|
|
- |
|
|
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]] || [[ "$VULKAN_BUILD_TARGET" == "MACOS" ]]; then
|
|
# Install dependencies
|
|
python scripts/update_deps.py --dir=external $UPDATE_DEPS_EXTRA_OPTIONS
|
|
# Get Google Test
|
|
git clone https://github.com/google/googletest.git external/googletest
|
|
pushd ${TRAVIS_BUILD_DIR}/external/googletest
|
|
git checkout tags/release-1.8.1
|
|
popd
|
|
fi
|
|
- |
|
|
if [[ "$CHECK_FORMAT" == "ON" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then
|
|
# Install the clang format diff tool, but only for pull requests.
|
|
curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py -o scripts/clang-format-diff.py;
|
|
fi
|
|
# Misc setup
|
|
- |
|
|
- export core_count=$(nproc || echo 4) && echo core_count = $core_count
|
|
- set +e
|
|
|
|
# It is important to use `unset -f cd` on MacOS because RVM overrides it, which causes conflicts with `set -e`
|
|
|
|
script:
|
|
- set -e
|
|
- |
|
|
if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]] || [[ "$VULKAN_BUILD_TARGET" == "MACOS" ]]; then
|
|
# Build Vulkan-Loader
|
|
mkdir build
|
|
cd build
|
|
cmake -DCMAKE_BUILD_TYPE=Debug -C../external/helper.cmake ..
|
|
make -j $core_count
|
|
cd ..
|
|
fi
|
|
- |
|
|
if [[ "$CHECK_FORMAT" == "ON" ]]; then
|
|
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
|
|
# Run the clang format check only for pull request builds because the
|
|
# master branch is needed to do the git diff.
|
|
echo "Checking clang-format between TRAVIS_BRANCH=$TRAVIS_BRANCH and TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH"
|
|
./scripts/check_code_format.sh
|
|
else
|
|
echo "Skipping clang-format check since this is not a pull request."
|
|
fi
|
|
fi
|
|
- |
|
|
if [[ "$CHECK_COMMIT_FORMAT" == "ON" ]]; then
|
|
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
|
|
echo "Checking commit message formats: See CONTRIBUTING.md"
|
|
./scripts/check_commit_message_format.sh
|
|
fi
|
|
fi
|
|
- set +e
|
|
|
|
notifications:
|
|
email:
|
|
recipients:
|
|
- karl@lunarg.com
|
|
- lenny@lunarg.com
|
|
on_success: change
|
|
on_failure: always
|