.travis.yml 5.12 KB
Newer Older
1
language: cpp
Milo Yip's avatar
Milo Yip committed
2 3 4
sudo: false
cache:
  - ccache
5

Milo Yip's avatar
Milo Yip committed
6 7 8 9 10
addons:
  apt:
    packages: &default_packages
      - cmake
      - valgrind
11 12

env:
Milo Yip's avatar
Milo Yip committed
13 14 15 16 17
global:
    - USE_CCACHE=1
    - CCACHE_SLOPPINESS=pch_defines,time_macros
    - CCACHE_COMPRESS=1
    - CCACHE_MAXSIZE=100M
18 19
    - ARCH_FLAGS_x86='-m32'        # #266: don't use SSE on 32-bit
    - ARCH_FLAGS_x86_64='-msse4.2' #       use SSE4.2 on 64-bit
20
    - GITHUB_REPO='miloyip/rapidjson'
Milo Yip's avatar
Milo Yip committed
21
    - secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk="
22

Milo Yip's avatar
Milo Yip committed
23 24
matrix:
  include:
Milo Yip's avatar
Milo Yip committed
25 26
    # gcc
    - env: CONF=release ARCH=x86    CXX11=ON
Milo Yip's avatar
Milo Yip committed
27 28 29 30 31 32 33
      compiler: gcc
      addons:
        apt:
          packages:
            - *default_packages
            - g++-multilib
            - libc6-dbg:i386
Milo Yip's avatar
Milo Yip committed
34
    - env: CONF=release ARCH=x86_64 CXX11=ON
Milo Yip's avatar
Milo Yip committed
35
      compiler: gcc
Milo Yip's avatar
Milo Yip committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
    - env: CONF=debug   ARCH=x86    CXX11=OFF
      compiler: gcc
      addons:
        apt:
          packages:
            - *default_packages
            - g++-multilib
            - libc6-dbg:i386
    - env: CONF=debug   ARCH=x86_64 CXX11=OFF
      compiler: gcc
    # clang
    - env: CONF=debug   ARCH=x86    CXX11=ON CCACHE_CPP2=yes
      compiler: clang
      addons:
        apt:
Milo Yip's avatar
Milo Yip committed
51 52
          sources:
            - llvm-toolchain-precise-3.7
Milo Yip's avatar
Milo Yip committed
53
            - ubuntu-toolchain-r-test
Milo Yip's avatar
Milo Yip committed
54 55 56 57
          packages:
            - *default_packages
            - g++-multilib
            - libc6-dbg:i386
Milo Yip's avatar
Milo Yip committed
58
            - clang-3.7
Milo Yip's avatar
Milo Yip committed
59 60
    - env: CONF=debug   ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
      compiler: clang
Milo Yip's avatar
Milo Yip committed
61 62
      addons:
        apt:
Milo Yip's avatar
Milo Yip committed
63 64
          sources:
            - llvm-toolchain-precise-3.7
Milo Yip's avatar
Milo Yip committed
65
            - ubuntu-toolchain-r-test
Milo Yip's avatar
Milo Yip committed
66
          packages:
Milo Yip's avatar
Milo Yip committed
67
            - *default_packages
Milo Yip's avatar
Milo Yip committed
68
            - clang-3.7
Milo Yip's avatar
Milo Yip committed
69
    - env: CONF=debug   ARCH=x86    CXX11=OFF CCACHE_CPP2=yes
Milo Yip's avatar
Milo Yip committed
70 71 72
      compiler: clang
      addons:
        apt:
Milo Yip's avatar
Milo Yip committed
73 74
          sources:
            - llvm-toolchain-precise-3.7
Milo Yip's avatar
Milo Yip committed
75
            - ubuntu-toolchain-r-test
Milo Yip's avatar
Milo Yip committed
76 77 78 79
          packages:
            - *default_packages
            - g++-multilib
            - libc6-dbg:i386
Milo Yip's avatar
Milo Yip committed
80
            - clang-3.7
Milo Yip's avatar
Milo Yip committed
81
    - env: CONF=debug   ARCH=x86_64 CXX11=OFF CCACHE_CPP2=yes
Milo Yip's avatar
Milo Yip committed
82
      compiler: clang
Milo Yip's avatar
Milo Yip committed
83 84
      addons:
        apt:
Milo Yip's avatar
Milo Yip committed
85 86
          sources:
            - llvm-toolchain-precise-3.7
Milo Yip's avatar
Milo Yip committed
87
            - ubuntu-toolchain-r-test
Milo Yip's avatar
Milo Yip committed
88
          packages:
Milo Yip's avatar
Milo Yip committed
89
            - *default_packages
Milo Yip's avatar
Milo Yip committed
90
            - clang-3.7
Milo Yip's avatar
Milo Yip committed
91
    - env: CONF=release ARCH=x86    CXX11=ON CCACHE_CPP2=yes
Milo Yip's avatar
Milo Yip committed
92 93 94
      compiler: clang
      addons:
        apt:
Milo Yip's avatar
Milo Yip committed
95 96
          sources:
            - llvm-toolchain-precise-3.7
Milo Yip's avatar
Milo Yip committed
97
            - ubuntu-toolchain-r-test
Milo Yip's avatar
Milo Yip committed
98 99 100 101
          packages:
            - *default_packages
            - g++-multilib
            - libc6-dbg:i386
Milo Yip's avatar
Milo Yip committed
102
            - clang-3.7
Milo Yip's avatar
Milo Yip committed
103
    - env: CONF=release ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
Milo Yip's avatar
Milo Yip committed
104
      compiler: clang
Milo Yip's avatar
Milo Yip committed
105 106
      addons:
        apt:
Milo Yip's avatar
Milo Yip committed
107 108
          sources:
            - llvm-toolchain-precise-3.7
Milo Yip's avatar
Milo Yip committed
109
            - ubuntu-toolchain-r-test
Milo Yip's avatar
Milo Yip committed
110
          packages:
Milo Yip's avatar
Milo Yip committed
111
            - *default_packages
Milo Yip's avatar
Milo Yip committed
112
            - clang-3.7
Milo Yip's avatar
Milo Yip committed
113
    # coverage report
Milo Yip's avatar
Milo Yip committed
114
    - env: CONF=debug   ARCH=x86    CXX11=ON GCOV_FLAGS='--coverage'
Milo Yip's avatar
Milo Yip committed
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
      compiler: gcc
      cache:
        - ccache
        - pip
      addons:
        apt:
          packages:
            - *default_packages
            - g++-multilib
            - libc6-dbg:i386
      after_success:
        - pip install --user cpp-coveralls
        - 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
    - env: CONF=debug   ARCH=x86_64 GCOV_FLAGS='--coverage'
      compiler: gcc
      cache:
        - ccache
        - pip
      addons:
        apt:
          packages:
            - *default_packages
            - g++-multilib
            - libc6-dbg:i386
      after_success:
        - pip install --user cpp-coveralls
        - 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
    - script: # Documentation task
      - cd build
      - cmake .. -DRAPIDJSON_HAS_STDSTRING=ON -DCMAKE_VERBOSE_MAKEFILE=ON
      - make travis_doc
      cache: false
      addons:
        apt:
          packages:
            - doxygen
151 152

before_script:
Milo Yip's avatar
Milo Yip committed
153 154 155 156
    - ccache -s
      #   hack to avoid Valgrind bug (https://bugs.kde.org/show_bug.cgi?id=326469),
      #   exposed by merging PR#163 (using -march=native)
      #   TODO: Since this bug is already fixed. Remove this when valgrind can be upgraded.
157
    - sed -i "s/-march=native//" CMakeLists.txt
Milo Yip's avatar
Milo Yip committed
158
    - mkdir build
159 160

script:
Milo Yip's avatar
Milo Yip committed
161
  - if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi
Milo Yip's avatar
Milo Yip committed
162 163 164 165
  - >
      eval "ARCH_FLAGS=\${ARCH_FLAGS_${ARCH}}" ;
      (cd build && cmake
      -DRAPIDJSON_HAS_STDSTRING=ON
Milo Yip's avatar
Milo Yip committed
166
      -DRAPIDJSON_BUILD_CXX11=$CXX11
Milo Yip's avatar
Milo Yip committed
167 168 169 170 171
      -DCMAKE_VERBOSE_MAKEFILE=ON
      -DCMAKE_BUILD_TYPE=$CONF
      -DCMAKE_CXX_FLAGS="$ARCH_FLAGS $GCOV_FLAGS"
      -DCMAKE_EXE_LINKER_FLAGS=$GCOV_FLAGS
      ..)
172
  - cd build
Milo Yip's avatar
Milo Yip committed
173 174 175
  - make tests -j 2
  - make examples -j 2
  - ctest -j 2 -V `[ "$CONF" = "release" ] || echo "-E perftest"`