Skip to content
Snippets Groups Projects
.travis.yml 1.54 KiB
Newer Older
  • Learn to ignore specific revisions
  • Konstantinos Sideris's avatar
    Konstantinos Sideris committed
    ---
    
    language: cpp
    sudo: required
    dist: trusty
    
    services:
      - docker
    
    notifications:
      email: false
    
    matrix:
      include:
        - os: osx
    
          osx_image: xcode9
    
    Konstantinos Sideris's avatar
    Konstantinos Sideris committed
          compiler: clang
    
        - os: linux
          compiler: gcc
          env:
            - CXX_VERSION=g++-8
            - CC_VERSION=gcc-8
    
    Konstantinos Sideris's avatar
    Konstantinos Sideris committed
        - os: linux
          compiler: clang
          env:
    
            - CXX_VERSION=clang++-6.0
    
            - CC_VERSION=clang-6.0
    
    Konstantinos Sideris's avatar
    Konstantinos Sideris committed
    install:
    
      if [ "$TRAVIS_OS_NAME" = "linux" ]; then docker build -t nheko-reborn/mtxclient -f Dockerfile . ; fi
    
    
      - ./.ci/install.sh
    
    Konstantinos Sideris's avatar
    Konstantinos Sideris committed
    
    script:
      - $CXX --version
      - cmake --version
    
    
      # Start the synapse server to run the tests.
      - if [ $TRAVIS_OS_NAME == linux ]; then make synapse; fi
    
      # Build the lib and run the test suite against synapse.
      - |
        if [ $TRAVIS_OS_NAME == linux ]; then
          docker run -v `pwd`:/build --net=host \
            -e CXX_VERSION=${CXX_VERSION} \
            -e CC_VERSION=${CC_VERSION} \
            -e COVERAGE=${COVERAGE} \
            -e TRAVIS_OS_NAME=${TRAVIS_OS_NAME} \
    
    Joe Donofry's avatar
    Joe Donofry committed
            nheko-reborn/mtxclient \
    
            /bin/bash -c "./.ci/script.sh"
        fi
    
      # Build the lib and run the linter.
      - |
        if [ $TRAVIS_OS_NAME == osx ]; then
          ./.ci/script.sh
        fi
    
    
    after_success:
    
      # Generate coverage report and upload report to CodeCov.
    
      - |
        if [ $COVERAGE == ON ]; then
          docker run -v `pwd`:/build \
    
    Joe Donofry's avatar
    Joe Donofry committed
            --net=host nheko-reborn/mtxclient \
    
            /bin/bash -c "make -C build -j1 test_coverage && ./.ci/coverage.sh" && \
    
          bash <(curl -s https://codecov.io/bash) -f "!*tests*" || echo "Codecov failed"
        fi