|
1 | 1 | language: cpp
|
2 | 2 | dist: trusty
|
3 |
| - |
| 3 | +sudo: required |
| 4 | +services: |
| 5 | + - docker |
4 | 6 | before_install:
|
5 |
| - - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y |
6 |
| - - sudo apt-get update -qq |
7 |
| - - sudo apt-get install -qq libcurl4-openssl-dev libjsoncpp-dev libargtable2-dev libgnutls-dev libgcrypt11-dev valgrind wget gcc-5 g++-5 |
8 |
| - - wget http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.52.tar.gz |
9 |
| - - tar -xvf libmicrohttpd-0.9.52.tar.gz |
10 |
| - - cd libmicrohttpd-0.9.52 |
11 |
| - - ./configure && make |
12 |
| - - sudo make install && sudo ldconfig |
13 |
| - - cd .. && sudo rm -rf libmicrohttpd-0.9.52 |
14 |
| - - sudo pip install codecov |
15 |
| - - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y |
16 |
| - - sudo apt-get update -qq |
17 |
| - - if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi |
18 |
| - |
19 |
| -install: |
20 |
| - - if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi |
21 |
| - - sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-5 90 |
| 7 | + - | |
| 8 | + if [[ "$OS" == "native" && "$TRAVIS_OS_NAME" == "linux" ]] |
| 9 | + then |
| 10 | + sudo apt-get install -qq wget |
| 11 | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y |
| 12 | + sudo add-apt-repository 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main' -y |
| 13 | + wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - |
| 14 | + sudo apt-get update -qq |
| 15 | + sudo apt-get install -qq libcurl4-openssl-dev libhiredis-dev redis-server libjsoncpp-dev libargtable2-dev libgnutls-dev libgcrypt11-dev valgrind wget gcc-5 g++-5 clang-5.0 |
| 16 | + wget http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.52.tar.gz |
| 17 | + tar -xvf libmicrohttpd-0.9.52.tar.gz |
| 18 | + cd libmicrohttpd-0.9.52 |
| 19 | + ./configure && make |
| 20 | + sudo make install && sudo ldconfig |
| 21 | + cd .. && sudo rm -rf libmicrohttpd-0.9.52 |
| 22 | + sudo pip install codecov |
| 23 | + sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-5 90 |
| 24 | + elif [[ "$TRAVIS_OS_NAME" == "osx" ]] |
| 25 | + then |
| 26 | + brew update |
| 27 | + brew install jsoncpp argtable curl hiredis redis |
| 28 | + brew install libmicrohttpd --with-ssl |
| 29 | + fi |
22 | 30 |
|
23 |
| -env: |
24 |
| - - HTTP_SERVER=YES HTTP_CLIENT=YES COMPILE_STUBGEN=YES |
| 31 | +matrix: |
| 32 | + include: |
| 33 | + - env: OS=fedora |
| 34 | + os: linux |
| 35 | + - env: OS=arch |
| 36 | + os: linux |
| 37 | + - env: OS=debian8 |
| 38 | + os: linux |
| 39 | + - env: OS=debian9 |
| 40 | + os: linux |
| 41 | + - env: OS=debian10 |
| 42 | + os: linux |
| 43 | + - env: OS=ubuntu1604 |
| 44 | + os: linux |
| 45 | + - env: OS=ubuntu1704 |
| 46 | + os: linux |
| 47 | + - env: OS=native |
| 48 | + os: linux |
| 49 | + compiler: clang |
| 50 | + - env: OS=native |
| 51 | + os: linux |
| 52 | + compiler: gcc |
| 53 | + - env: OS=native |
| 54 | + os: osx |
| 55 | + compiler: clang |
25 | 56 |
|
26 | 57 | compiler:
|
27 |
| - - gcc |
| 58 | + - gcc |
28 | 59 |
|
29 | 60 | script:
|
30 |
| - - mkdir -p build && cd build |
31 |
| - - cmake -DCMAKE_BUILD_TYPE=Debug -DHTTP_CLIENT=${HTTP_CLIENT} -DHTTP_SERVER=${HTTP_SERVER} -DCOMPILE_STUBGEN=${COMPILE_STUBGEN} .. |
32 |
| - - make |
33 |
| - - make test |
34 |
| - - sudo make install && sudo ldconfig |
35 |
| - - g++ ../src/examples/simpleclient.cpp -ljsonrpccpp-client -ljsoncpp -ljsonrpccpp-common -lcurl -o sampleclient |
36 |
| - - g++ ../src/examples/simpleserver.cpp -ljsonrpccpp-server -ljsoncpp -ljsonrpccpp-common -lmicrohttpd -o sampleserver |
37 |
| - - sudo make uninstall |
38 |
| - - cd .. |
39 |
| - - ./dev/codecov.sh |
40 |
| -after_success: |
41 |
| - - bash <(curl -s https://codecov.io/bash) |
| 61 | + - if [[ "$OS" == "native" ]]; then ./docker/build_test_install.sh; fi |
| 62 | + - if [[ "$OS" == "native" && "$TRAVIS_OS_NAME" == "linux" && "$COMPILER" == "gcc" ]]; then ./dev/codecov.sh; fi |
| 63 | + - if [[ "$OS" != "native" ]]; then cd docker; make ${OS}; fi |
0 commit comments