Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.5 KiB
Newer Older
Arnaud Duvermy's avatar
Arnaud Duvermy committed
# The Docker image that will be used to build your app
image: rocker/tidyverse:4.3.2
Arnaud Duvermy's avatar
Arnaud Duvermy committed

before_script:
  - apt-get update
Arnaud Duvermy's avatar
Arnaud Duvermy committed
  - apt-get install -y --no-install-recommends libcurl4-openssl-dev libxext6 libxtst6 libxt6
Arnaud Duvermy's avatar
Arnaud Duvermy committed
  - apt-get install -y --no-install-recommends qpdf pandoc pandoc-citeproc
  - R -e 'install.packages(c("testthat", "rmarkdown"));'
Arnaud Duvermy's avatar
Arnaud Duvermy committed
  - R -e "install.packages(c('rsconnect', 'matrix', 'parallel', 'data.table', 'ggplot2', 'gridExtra', 'glmmTMB', 'magrittr', 'MASS', 'reshape2', 'rlang', 'stats', 'utils', 'BiocManager', 'car'))" 
  - R -e "BiocManager::install('S4Vectors', update = FALSE)"
  - R -e "BiocManager::install('DESeq2', update = FALSE)" 
Arnaud Duvermy's avatar
Arnaud Duvermy committed
  - R -e 'install.packages(setdiff(desc::desc()$get_deps()$package, c(installed.packages(), "R")));'
  - R -e 'update.packages(ask = FALSE, checkBuilt = TRUE)' 
Arnaud Duvermy's avatar
Arnaud Duvermy committed
devtools-check:
  stage: build
  script:
    - R -e 'devtools::check(error_on = "error")'
unit_test_coverage:
    stage: test
    allow_failure: true
    when: on_success
    only:
        - master
    script:
Arnaud Duvermy's avatar
Arnaud Duvermy committed
        - Rscript -e 'install.packages("covr")'
        - Rscript -e 'install.packages("DT")'
Arnaud Duvermy's avatar
Arnaud Duvermy committed
        - Rscript -e 'covr::gitlab(quiet = FALSE)'
    coverage: '/HTRfit Coverage: \d+(?:\.d+)?/' # regex to extract coverage percentage
      paths:
Arnaud Duvermy's avatar
Arnaud Duvermy committed
        - public/


pages:
  stage: build
  script:
  - R -e "devtools::document(); pkgdown::build_site(override = list(destination = 'public/'))"
  artifacts:
    paths:
    - public/
  only:
    variables:
    - $CI_COMMIT_REF_NAME == "master"