.travis.yml 5.0 KB
Newer Older
N
Niels 已提交
1 2
language: cpp

3 4
dist: trusty
sudo: required
N
Niels 已提交
5

N
Niels 已提交
6 7 8 9 10 11
env:
  global:
   # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
   #   via the "travis encrypt" command using the project repo's public key
   - secure: "m89SSgE+ASLO38rSKx7MTXK3n5NkP9bIx95jwY71YEiuFzib30PDJ/DifKnXxBjvy/AkCGztErQRk/8ZCvq+4HXozU2knEGnL/RUitvlwbhzfh2D4lmS3BvWBGS3N3NewoPBrRmdcvnT0xjOGXxtZaJ3P74TkB9GBnlz/HmKORA="

N
Niels 已提交
12
# from http://stackoverflow.com/a/32127147/266378
N
Niels 已提交
13 14 15 16 17 18 19 20 21 22
matrix:
  include:
    - os: linux
      compiler: gcc
      addons:
        apt:
          sources: ['ubuntu-toolchain-r-test']
          packages: ['g++-4.9', 'valgrind', 'python-pip', 'python-yaml']
      before_script:
        - pip install --user git+git://github.com/eddyxu/cpp-coveralls.git
N
cleanup  
Niels 已提交
23 24 25
      after_success:
        - make clean
        - touch src/json.hpp
N
Niels 已提交
26
        - make json_unit CXXFLAGS="-fprofile-arcs -ftest-coverage -std=c++11 -lstdc++" CXX=$COMPILER
N
cleanup  
Niels 已提交
27
        - ./json_unit "*"
28
        - coveralls --exclude test/src/catch.hpp --exclude test/src/unit.cpp --include src/json.hpp --gcov-options '\-lp' --gcov 'gcov-4.9'
N
Niels 已提交
29
        - bash <(curl -s https://codecov.io/bash)
N
Niels 已提交
30
      env: COMPILER=g++-4.9
N
Niels 已提交
31 32 33

    - os: linux
      compiler: gcc
N
Niels 已提交
34
      before_install: echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
N
Niels 已提交
35 36 37 38
      addons:
        apt:
          sources: ['ubuntu-toolchain-r-test']
          packages: ['g++-5', 'valgrind']
N
Niels 已提交
39 40 41 42 43
        coverity_scan:
          project:
            name: "nlohmann/json"
            description: "Build submitted via Travis CI"
          notification_email: niels.lohmann@gmail.com
N
Niels 已提交
44
          build_command_prepend: "make clean ; sudo cp $(which g++-5) $(which g++)"
N
cleanup  
Niels 已提交
45
          build_command: "make"
N
Niels 已提交
46
          branch_pattern: coverity_scan
N
Niels 已提交
47
      env: COMPILER=g++-5
N
Niels 已提交
48

N
Niels 已提交
49 50 51 52 53 54 55 56
    - os: linux
      compiler: gcc
      addons:
        apt:
          sources: ['ubuntu-toolchain-r-test']
          packages: ['g++-6', 'valgrind']
      env: COMPILER=g++-6

N
Niels 已提交
57 58 59 60 61
    # from https://github.com/travis-ci/travis-ci/issues/6120
    - os: linux
      env:
        - LLVM_VERSION=3.8.0
        - LLVM_ARCHIVE_PATH=$HOME/clang+llvm.tar.xz
N
Niels 已提交
62
        - COMPILER=clang++
N
Niels 已提交
63
        - CPPFLAGS="-I $HOME/clang-$LLVM_VERSION/include/c++/v1"
N
Niels 已提交
64
        - CXXFLAGS=-lc++
N
Niels 已提交
65
        - PATH=$HOME/clang-$LLVM_VERSION/bin:$PATH
N
Niels 已提交
66
        - LD_LIBRARY_PATH=$HOME/clang-$LLVM_VERSION/lib:$LD_LIBRARY_PATH
N
Niels 已提交
67 68 69 70
      before_install:
       - wget http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-14.04.tar.xz -O $LLVM_ARCHIVE_PATH
       - mkdir $HOME/clang-$LLVM_VERSION
       - tar xf $LLVM_ARCHIVE_PATH -C $HOME/clang-$LLVM_VERSION --strip-components 1
N
Niels 已提交
71

N
Niels 已提交
72 73
    # Clang 3.5 is not able to compile the code,
    # see https://travis-ci.org/nlohmann/json/jobs/126720186
N
Niels 已提交
74

N
Niels 已提交
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
#    - os: linux
#      compiler: clang
#      addons:
#        apt:
#          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
#          packages: ['clang-3.6', 'valgrind']
#      env: COMPILER=clang++-3.6
#
#    - os: linux
#      compiler: clang
#      addons:
#        apt:
#          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
#          packages: ['clang-3.7', 'valgrind']
#      env: COMPILER=clang++-3.7
#
#    - os: linux
#      compiler: clang
#      addons:
#        apt:
#          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
#          packages: ['clang-3.8', 'valgrind']
#      env: COMPILER=clang++-3.8
N
Niels 已提交
98

N
Niels 已提交
99 100 101 102 103 104 105
  #  - os: linux
  #    compiler: clang
  #    addons:
  #      apt:
  #        sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise']
  #        packages: ['clang-3.9', 'valgrind']
  #    env: COMPILER=clang++-3.9
N
Niels 已提交
106

N
cleanup  
Niels 已提交
107 108 109
    - os: osx
      osx_image: beta-xcode6.1
      compiler: clang
N
Niels 已提交
110
      env:
N
Niels 已提交
111
       - COMPILER=clang
N
Niels 已提交
112
       - CXXFLAGS=-lstdc++
N
cleanup  
Niels 已提交
113 114 115 116

    - os: osx
      osx_image: beta-xcode6.2
      compiler: clang
N
Niels 已提交
117
      env:
N
Niels 已提交
118
       - COMPILER=clang
N
Niels 已提交
119
       - CXXFLAGS=-lstdc++
N
cleanup  
Niels 已提交
120

N
Niels 已提交
121 122 123
    - os: osx
      osx_image: beta-xcode6.3
      compiler: clang
N
Niels 已提交
124
      env:
N
Niels 已提交
125
       - COMPILER=clang
N
Niels 已提交
126
       - CXXFLAGS=-lstdc++
N
cleanup  
Niels 已提交
127 128 129 130

    - os: osx
      osx_image: xcode6.4
      compiler: clang
N
Niels 已提交
131
      env:
N
Niels 已提交
132
       - COMPILER=clang
N
Niels 已提交
133
       - CXXFLAGS=-lstdc++
N
cleanup  
Niels 已提交
134

N
Niels 已提交
135 136 137
    - os: osx
      osx_image: xcode7.1
      compiler: clang
N
Niels 已提交
138
      env:
N
Niels 已提交
139
       - COMPILER=clang
N
Niels 已提交
140
       - CXXFLAGS=-lstdc++
N
Niels 已提交
141
     
N
Niels 已提交
142 143 144
    - os: osx
      osx_image: xcode7.2
      compiler: clang
N
Niels 已提交
145
      env:
N
Niels 已提交
146
       - COMPILER=clang
N
Niels 已提交
147
       - CXXFLAGS=-lstdc++
N
Niels 已提交
148

N
Niels 已提交
149 150 151
    - os: osx
      osx_image: xcode7.3
      compiler: clang
N
Niels 已提交
152
      env:
N
Niels 已提交
153
       - COMPILER=clang
N
Niels 已提交
154
       - CXXFLAGS=-lstdc++
N
Niels 已提交
155

N
Niels 已提交
156 157 158 159 160 161 162
    - os: osx
      osx_image: xcode8
      compiler: clang
      env:
       - COMPILER=clang
       - CXXFLAGS=-lstdc++

N
Niels 已提交
163
script:
N
Niels 已提交
164
  - uname -a
N
Niels 已提交
165 166
  - $COMPILER --version
  - make CXX=$COMPILER
167
  - ./json_unit "*"
N
Niels 已提交
168
  - if [ `which valgrind` ]; then
N
Niels 已提交
169 170
    valgrind --error-exitcode=1 --leak-check=full ./json_unit ;
    fi
N
Niels 已提交
171
  - if [ $TRAVIS_OS_NAME="osx" ]; then
N
Niels 已提交
172 173
    brew tap nlohmann/json ;
    brew install nlohmann_json --HEAD ;
N
Niels 已提交
174
    brew test nlohmann_json ;
N
Niels 已提交
175
    fi