2
0

.travis.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. language: c
  2. compiler:
  3. - gcc
  4. - clang
  5. os:
  6. - linux
  7. - osx
  8. dist: bionic
  9. branches:
  10. only:
  11. - staging
  12. - trying
  13. - master
  14. - /^release\/.*$/
  15. install:
  16. - if [ "$BITS" == "64" ]; then
  17. wget https://github.com/redis/redis/archive/6.0.6.tar.gz;
  18. tar -xzvf 6.0.6.tar.gz;
  19. pushd redis-6.0.6 && BUILD_TLS=yes make && export PATH=$PWD/src:$PATH && popd;
  20. fi
  21. before_script:
  22. - if [ "$TRAVIS_OS_NAME" == "osx" ]; then
  23. curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.6.2-10.13-HighSierra.pkg;
  24. sudo installer -pkg MacPorts-2.6.2-10.13-HighSierra.pkg -target /;
  25. export PATH=$PATH:/opt/local/bin && sudo port -v selfupdate;
  26. sudo port -N install openssl redis;
  27. fi;
  28. addons:
  29. apt:
  30. sources:
  31. - sourceline: 'ppa:chris-lea/redis-server'
  32. packages:
  33. - libc6-dbg
  34. - libc6-dev
  35. - libc6:i386
  36. - libc6-dev-i386
  37. - libc6-dbg:i386
  38. - gcc-multilib
  39. - g++-multilib
  40. - libssl-dev
  41. - libssl-dev:i386
  42. - valgrind
  43. - redis
  44. env:
  45. - BITS="32"
  46. - BITS="64"
  47. script:
  48. - EXTRA_CMAKE_OPTS="-DENABLE_EXAMPLES:BOOL=ON -DENABLE_SSL:BOOL=ON";
  49. if [ "$BITS" == "64" ]; then
  50. EXTRA_CMAKE_OPTS="$EXTRA_CMAKE_OPTS -DENABLE_SSL_TESTS:BOOL=ON";
  51. fi;
  52. if [ "$TRAVIS_OS_NAME" == "osx" ]; then
  53. if [ "$BITS" == "32" ]; then
  54. CFLAGS="-m32 -Werror";
  55. CXXFLAGS="-m32 -Werror";
  56. LDFLAGS="-m32";
  57. EXTRA_CMAKE_OPTS=;
  58. else
  59. CFLAGS="-Werror";
  60. CXXFLAGS="-Werror";
  61. fi;
  62. else
  63. TEST_PREFIX="valgrind --track-origins=yes --leak-check=full";
  64. if [ "$BITS" == "32" ]; then
  65. CFLAGS="-m32 -Werror";
  66. CXXFLAGS="-m32 -Werror";
  67. LDFLAGS="-m32";
  68. EXTRA_CMAKE_OPTS=;
  69. else
  70. CFLAGS="-Werror";
  71. CXXFLAGS="-Werror";
  72. fi;
  73. fi;
  74. export CFLAGS CXXFLAGS LDFLAGS TEST_PREFIX EXTRA_CMAKE_OPTS
  75. - make && make clean;
  76. if [ "$TRAVIS_OS_NAME" == "osx" ]; then
  77. if [ "$BITS" == "64" ]; then
  78. OPENSSL_PREFIX="$(ls -d /usr/local/Cellar/openssl@1.1/*)" USE_SSL=1 make;
  79. fi;
  80. else
  81. USE_SSL=1 make;
  82. fi;
  83. - mkdir build/ && cd build/
  84. - cmake .. ${EXTRA_CMAKE_OPTS}
  85. - make VERBOSE=1
  86. - if [ "$BITS" == "64" ]; then
  87. TEST_SSL=1 SKIPS_AS_FAILS=1 ctest -V;
  88. else
  89. SKIPS_AS_FAILS=1 ctest -V;
  90. fi;
  91. jobs:
  92. include:
  93. # Windows MinGW cross compile on Linux
  94. - os: linux
  95. dist: xenial
  96. compiler: mingw
  97. addons:
  98. apt:
  99. packages:
  100. - ninja-build
  101. - gcc-mingw-w64-x86-64
  102. - g++-mingw-w64-x86-64
  103. script:
  104. - mkdir build && cd build
  105. - CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_WITH_INSTALL_RPATH=on
  106. - ninja -v
  107. # Windows MSVC 2017
  108. - os: windows
  109. compiler: msvc
  110. env:
  111. - MATRIX_EVAL="CC=cl.exe && CXX=cl.exe"
  112. before_install:
  113. - eval "${MATRIX_EVAL}"
  114. install:
  115. - choco install ninja
  116. - choco install -y memurai-developer
  117. script:
  118. - mkdir build && cd build
  119. - cmd.exe //C 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat' amd64 '&&'
  120. cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_EXAMPLES=ON '&&' ninja -v
  121. - ./hiredis-test.exe