.language: cpp
sudo: false

dist: trusty

branches:
  only:
    - master
    - staging

matrix:
  include: 
    - os: linux  
      compiler: gcc
      addons:
        apt:
          packages:
            - libhdf5-serial-dev
            - zlib1g-dev
            - libatlas-base-dev
            - valgrind
            - lcov
            - graphviz
            - doxygen
            - doxygen-latex
            - cppcheck
            - libboost-serialization-dev
      env: ENABLE_GCOV_COVERAGE=TRUE
      before_install: 
        - gem install coveralls-lcov
      after_success: 
        - ./scripts/run-coveralls.sh
    - os: osx
      compiler: clang
      before_install: brew install hdf5 cppcheck
        
install:
    - ./scripts/run-build.sh

script:  
    - ./scripts/run-cpputest.sh
    - ./scripts/run-cppcheck.sh
    - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/run-valgrind.sh; fi
    - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/run-doxygen.sh; fi

notifications:
  slack: 
    rooms:
      - icb-dcm:PHyGJ38Zhp8HrwIxjZAwh9ZI#amici-dev
    on_success: change

.language: cpp
sudo: false

dist: trusty

branches:
  only:
    - master
    - staging

matrix:
  include: 
    - os: linux  
      compiler: gcc
      addons:
        apt:
          packages:
            - libhdf5-serial-dev
            - zlib1g-dev
            - libatlas-base-dev
            - valgrind
            - lcov
            - graphviz
            - doxygen
            - doxygen-latex
            - cppcheck
            - libboost-serialization-dev
      env: ENABLE_GCOV_COVERAGE=TRUE
      before_install: 
        - gem install coveralls-lcov
      after_success: 
        - ./scripts/run-coveralls.sh
    - os: osx
      compiler: clang
      before_install: 
        - rvm install ruby-2.3.3 && rvm --default use 2.3.3 # otherwise homebrew fails
        - brew install hdf5 cppcheck
        
install:
    - ./scripts/run-build.sh

script:  
    - ./scripts/run-cpputest.sh
    - ./scripts/run-cppcheck.sh
    - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/run-valgrind.sh; fi
    - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/run-doxygen.sh; fi

notifications:
  slack: 
    rooms:
      - icb-dcm:PHyGJ38Zhp8HrwIxjZAwh9ZI#amici-dev
    on_success: change

Fix CI homebrew error /usr/local/Homebrew/Library/Homebrew/brew.rb:12:in <main>: Homebrew must be run under Ruby 2.3
Fix CI homebrew error /usr/local/Homebrew/Library/Homebrew/brew.rb:12:in <main>: Homebrew must be run under Ruby 2.3
