variables:
  CRAN: "https://cran.rstudio.com"
  BIOC: "https://bioconductor.org/packages/3.4/bioc"

before_script:
  - apt-get update -qq
  - apt-get -y upgrade
  - apt-get install -y --no-install-recommends gawk wget texlive
  - apt-get install -y --no-install-recommends pandoc pandoc-citeproc
  - apt-get install -y --no-install-recommends libudunits2-dev libssl-dev libcurl4-openssl-dev libxml2-dev
  - apt-get install -y --no-install-recommends subversion
  - export _R_CHECK_CRAN_INCOMING_=FALSE
  - export R_BUILD_ARGS=""
  - export R_CHECK_ARGS=""
  - R -e "install.packages(c('devtools', 'roxygen2'), repos = c('${CRAN}', '$(BIOC)'))"
  - R -e "devtools::install_dev_deps()"

r-latest:
  image: r-base:latest
  script: 
    - make
    - PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1)
    - tar --list --verbose --file="${PKG_FILE_NAME}"
    - make check check-options="${R_CHECK_ARGS}"
    - if grep -q WARNING ${PKG_FILE_NAME}.Rcheck/00check.log; then exit 1; fi

