.travis.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Linux Build Configuration for Travis
  2. language: cpp
  3. os:
  4. - linux
  5. - osx
  6. # Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
  7. dist: trusty
  8. env:
  9. - DXC_BUILD_TYPE=Release
  10. - DXC_BUILD_TYPE=Debug
  11. compiler:
  12. - clang
  13. matrix:
  14. include:
  15. - os: linux
  16. compiler: gcc
  17. addons:
  18. apt:
  19. sources: ubuntu-toolchain-r-test
  20. packages: ninja-build g++-5
  21. env: DXC_BUILD_TYPE=Debug
  22. - os: linux
  23. compiler: gcc
  24. addons:
  25. apt:
  26. sources: ubuntu-toolchain-r-test
  27. packages: ninja-build g++-5
  28. env: DXC_BUILD_TYPE=Release
  29. # Configuration for AddressSanitizer (https://clang.llvm.org/docs/AddressSanitizer.html)
  30. - os: linux
  31. compiler: clang
  32. env:
  33. - DXC_BUILD_TYPE=Debug
  34. - BUILD_CONFIG=ASAN
  35. # Allow address sanitizer bot to fail for now. TODO(Remove this).
  36. allow_failures:
  37. - os: linux
  38. compiler: clang
  39. env:
  40. - DXC_BUILD_TYPE=Debug
  41. - BUILD_CONFIG=ASAN
  42. cache:
  43. apt: true
  44. git:
  45. depth: false
  46. branches:
  47. only:
  48. - master
  49. addons:
  50. apt:
  51. sources: ubuntu-toolchain-r-test
  52. packages: ninja-build libstdc++-5-dev
  53. before_install:
  54. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
  55. wget -q https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-mac.zip;
  56. unzip -q ninja-mac.zip;
  57. chmod +x ninja;
  58. export PATH="$PWD:$PATH";
  59. fi
  60. before_script:
  61. - git submodule update --init
  62. - if [ ${CC} = gcc ]; then CC=gcc-5; CXX=g++-5; CXX_FLAGS=; else CXX_FLAGS=-Werror; fi
  63. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ulimit -Sn 1024; fi
  64. - if [[ ${BUILD_CONFIG} = ASAN ]]; then ADDITIONAL_CMAKE_FLAGS="-DLLVM_USE_SANITIZER=Address -DSPIRV_USE_SANITIZER=address"; fi
  65. script:
  66. - mkdir build && cd build
  67. - cmake .. -GNinja
  68. $(cat ../utils/cmake-predefined-config-params)
  69. -DSPIRV_BUILD_TESTS=ON
  70. -DCMAKE_BUILD_TYPE=${DXC_BUILD_TYPE}
  71. -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX}
  72. -DCMAKE_CXX_FLAGS=${CXX_FLAGS}
  73. ${ADDITIONAL_CMAKE_FLAGS}
  74. - ninja
  75. - ./bin/dxc --help
  76. - ./bin/dxc -T ps_6_0 ../tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv
  77. - ./bin/dxc -T ps_6_0 -Fo passthru-ps.dxil ../tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv
  78. - ./bin/dxc -T ps_6_0 -Fo passthru-ps.spv ../tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv -spirv
  79. - ./bin/clang-spirv-tests --spirv-test-root ../tools/clang/test/CodeGenSPIRV/
  80. - ./bin/clang-hlsl-tests --HlslDataDir $PWD/../tools/clang/test/HLSL/
  81. # TODO: Bundle Linux/macOS build artifacts and upload them to a cloud storage
  82. # so users can download and use quickly.