blob: 7a8855971a7d514f341930f6f2728e904f3c1d7e [file] [log] [blame]
# Linux Build Configuration for Travis
language: cpp
os:
- linux
- osx
# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
sudo: required
dist: trusty
env:
- SHADERC_BUILD_TYPE=Release
- SHADERC_BUILD_TYPE=Debug
compiler:
- clang
- gcc
matrix:
fast_finish: true # Show final status immediately if a test fails.
exclude:
# Skip GCC builds on Mac OS X.
- os: osx
compiler: gcc
include:
# Additional GCC builds for code coverage.
- os: linux
compiler: gcc
env: SHADERC_CODE_COVERAGE=ON
# Additional build using Android NDK
- env: BUILD_NDK=ON
cache:
apt: true
branches:
only:
- master
addons:
apt:
packages:
- clang-3.6
- ninja-build
- lcov
before_install:
# Install ninja on Mac OS X.
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install ninja; fi
- if [[ "$BUILD_NDK" == "ON" ]]; then
git clone --depth=1 https://github.com/urho3d/android-ndk.git $HOME/android-ndk;
export ANDROID_NDK=$HOME/android-ndk;
git clone --depth=1 https://github.com/taka-no-me/android-cmake.git $HOME/android-cmake;
export TOOLCHAIN_PATH=$HOME/android-cmake/android.toolchain.cmake;
fi
install:
- pip install --user nose
- pip install --user cpp-coveralls
- export PATH=$HOME/.local/bin:$PATH # Make sure we can find the above Python packages
# Make sure that clang-3.6 is selected.
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then
export CC=clang-3.6 CXX=clang++-3.6;
fi
before_script:
- git clone https://github.com/google/googletest.git third_party/googletest
- git clone https://github.com/google/glslang.git third_party/glslang
- git clone https://github.com/KhronosGroup/SPIRV-Tools.git third_party/spirv-tools
- git clone https://github.com/KhronosGroup/SPIRV-Headers.git third_party/spirv-tools/external/spirv-headers
script:
- mkdir build && cd build
- if [[ "$BUILD_NDK" == "ON" ]]; then
cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH}
-DANDROID_NATIVE_API_LEVEL=android-9
-DCMAKE_BUILD_TYPE=Release
-DANDROID_ABI="armeabi-v7a with NEON"
-DSHADERC_SKIP_TESTS=ON
-GNinja ..;
else
cmake -DCMAKE_BUILD_TYPE=${SHADERC_BUILD_TYPE:-Debug}
-DENABLE_CODE_COVERAGE=${SHADERC_CODE_COVERAGE:-OFF}
-GNinja ..;
fi
- ninja
- if [[ "$BUILD_NDK" != "ON" ]]; then ctest -j`nproc` --output_on_failure; fi
after_success:
# Collect coverage and push to coveralls.info.
# Ignore third party source code and tests.
- if [[ "$CC" == "gcc" && "$SHADERC_CODE_COVERAGE" == "ON" ]]; then
coveralls
--root ../
--build-root ./
--exclude-pattern '.+/third_party/'
--exclude-pattern '.+/.+_test\.cc'
--exclude-pattern '.+/CMakeFiles/'
--gcov /usr/bin/gcov
--gcov-options '\--long-file-names --preserve-paths'
--verbose;
fi
notifications:
email:
recipients:
- antiagainst@google.com
- awoloszyn@google.com
- deki@google.com
- dneto@google.com
- qining@google.com
on_success: change
on_failure: always