.travis.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. sudo: required
  2. dist: trusty
  3. group: edge
  4. language: cpp
  5. cache:
  6. - ccache
  7. env:
  8. global:
  9. - USE_CCACHE=1
  10. - CCACHE_SLOPPINESS=pch_defines,time_macros
  11. - CCACHE_COMPRESS=1
  12. - CCACHE_MAXSIZE=100M
  13. - ARCH_FLAGS_x86='-m32' # #266: don't use SSE on 32-bit
  14. - ARCH_FLAGS_x86_64='-msse4.2' # use SSE4.2 on 64-bit
  15. - GITHUB_REPO='Tencent/rapidjson'
  16. - secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk="
  17. before_install:
  18. - sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
  19. - sudo apt-get update -qq
  20. - sudo apt-get install -y cmake valgrind g++-multilib libc6-dbg:i386
  21. matrix:
  22. include:
  23. # gcc
  24. - env: CONF=release ARCH=x86 CXX11=ON
  25. compiler: gcc
  26. - env: CONF=release ARCH=x86_64 CXX11=ON
  27. compiler: gcc
  28. - env: CONF=debug ARCH=x86 CXX11=OFF
  29. compiler: gcc
  30. - env: CONF=debug ARCH=x86_64 CXX11=OFF
  31. compiler: gcc
  32. # clang
  33. - env: CONF=debug ARCH=x86 CXX11=ON CCACHE_CPP2=yes
  34. compiler: clang
  35. - env: CONF=debug ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
  36. compiler: clang
  37. - env: CONF=debug ARCH=x86 CXX11=OFF CCACHE_CPP2=yes
  38. compiler: clang
  39. - env: CONF=debug ARCH=x86_64 CXX11=OFF CCACHE_CPP2=yes
  40. compiler: clang
  41. - env: CONF=release ARCH=x86 CXX11=ON CCACHE_CPP2=yes
  42. compiler: clang
  43. - env: CONF=release ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
  44. compiler: clang
  45. # coverage report
  46. - env: CONF=debug ARCH=x86 CXX11=ON GCOV_FLAGS='--coverage'
  47. compiler: gcc
  48. cache:
  49. - ccache
  50. - pip
  51. after_success:
  52. - pip install --user cpp-coveralls
  53. - coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
  54. - env: CONF=debug ARCH=x86_64 GCOV_FLAGS='--coverage'
  55. compiler: gcc
  56. cache:
  57. - ccache
  58. - pip
  59. after_success:
  60. - pip install --user cpp-coveralls
  61. - coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
  62. - script: # Documentation task
  63. - cd build
  64. - cmake .. -DRAPIDJSON_HAS_STDSTRING=ON -DCMAKE_VERBOSE_MAKEFILE=ON
  65. - make travis_doc
  66. cache: false
  67. addons:
  68. apt:
  69. packages:
  70. - doxygen
  71. before_script:
  72. - ccache -s
  73. # hack to avoid Valgrind bug (https://bugs.kde.org/show_bug.cgi?id=326469),
  74. # exposed by merging PR#163 (using -march=native)
  75. # TODO: Since this bug is already fixed. Remove this when valgrind can be upgraded.
  76. - sed -i "s/-march=native//" CMakeLists.txt
  77. - mkdir build
  78. script:
  79. - if [ "$CXX" = "clang++" ]; then export CXXFLAGS="-stdlib=libc++ ${CXXFLAGS}"; fi
  80. - >
  81. eval "ARCH_FLAGS=\${ARCH_FLAGS_${ARCH}}" ;
  82. (cd build && cmake
  83. -DRAPIDJSON_HAS_STDSTRING=ON
  84. -DRAPIDJSON_BUILD_CXX11=$CXX11
  85. -DCMAKE_VERBOSE_MAKEFILE=ON
  86. -DCMAKE_BUILD_TYPE=$CONF
  87. -DCMAKE_CXX_FLAGS="$ARCH_FLAGS $GCOV_FLAGS"
  88. -DCMAKE_EXE_LINKER_FLAGS=$GCOV_FLAGS
  89. ..)
  90. - cd build
  91. - make tests -j 2
  92. - make examples -j 2
  93. - ctest -j 2 -V `[ "$CONF" = "release" ] || echo "-E perftest"`