language: r
cache: packages
sudo: required
dist: trusty
latex: false
fortran: false

services:
  - docker

env:
  global:
    - NOT_CRAN=true
    - _R_CHECK_FORCE_SUGGESTS_=false
  matrix:
  include:
    - dist: trusty
    - dist: trusty
      r_check_args: '--ignore-vignettes'
      r_build_args: '--no-build-vignettes'
      addons:
        apt:
          update: true
          packages:
            - libmagick++-dev
            - librsvg2-dev
            - libwebp-dev
            - libpoppler-cpp-dev
            - libtesseract-dev
            - libleptonica-dev
            - tesseract-ocr-eng
            - r-cran-rgdal
            - libfftw3-dev
            - cargo
    - PIP="pip" RETICULATE_PYTHON="/usr/bin/python"
    - PYTHON=3 PIP="pip3" RETICULATE_PYTHON="/usr/bin/python3"

addons:
  apt:
    update: true
    sources:
      - sourceline: 'ppa:opencpu/imagemagick'
    packages:
      - libmagick++-dev
      - librsvg2-dev
      - libwebp-dev
      - libpoppler-cpp-dev
      - libtesseract-dev
      - libleptonica-dev
      - tesseract-ocr-eng
      - r-cran-rgdal
      - libfftw3-dev
      - cargo

bioc_packages:
  - EBImage

before_install:
  - docker pull scrapinghub/splash:3.0
  - docker run -p 5023:5023 -p 8050:8050 -p 8051:8051 -d scrapinghub/splash:3.0
  - docker ps -a
  - sudo apt-get -y install python${PYTHON}-pip python-dev python${PYTHON}-numpy
  - sudo $PIP install -U setuptools
  - sudo $PIP install -U docker
  - (while true; do echo 'Ping? Pong!'; sleep 500; done) &

r:
 - oldrel
 - release
 - devel

after_success:
  - Rscript -e 'covr::codecov()'