# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r
language: r
cache: packages

addons:
  apt:
    sources:
      - sourceline: 'ppa:chris-lea/libsodium'
      - sourceline: 'ppa:opencpu/jq'
    packages:
      - libsodium-dev
      - libprotobuf-dev
      - libprotoc-dev
      - protobuf-compiler
      - libudunits2-dev
      - libv8-3.14-dev
      - libjq-dev
      - libgdal-dev

matrix:
  include:
    - os: linux
      r: release
      env:
        - R_CODECOV=true
    - os: linux
      r: devel
    - os: linux
      r: oldrel
    - os: osx
      osx_image: xcode8.3

warnings_are_errors: true

notifications:
  email:
    on_success: change
    on_failure: change

after_success:
- if [[ "${R_CODECOV}" ]]; then Rscript -e 'covr::codecov()'; fi
