.travis.yml 3.4 KB

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