dist: bionic
language: c

addons:
  apt:
    packages:
      - lcov

os:
  - linux
  - osx
compiler:
  - clang
  - gcc

script:
  - mkdir build
  - cd build
  - cmake ..
  - make
  - make test
  - ./tests/testMyRays

jobs:
  include:
    - stage: "Coverage"
      os: linux
      compiler: gcc
      script:
        - mkdir coverage
        - cd coverage
        - cmake .. -DCOVERALLS=ON -DCMAKE_BUILD_TYPE=Debug
        - cmake --build .
        - cmake --build . --target coveralls
      after_success:
        - bash <(curl -s https://codecov.io/bash)