Example gitlab-ci.yml for R Projects

June 26, 2016

(This article was first published on r - Brandon Bertelsen, and kindly contributed to R-bloggers)

Example gitlab-ci.yml for R Projects

Most people are running open source projects, so they can easily use github and travis for free. I don’t have that luxury, but gitlab has really caught my attention lately. Combining gitlab, gitlab runner with docker makes things very straightforward. Here is an example .gitlab-ci.yml file that you would need to include in the base directory of your R project to have it run R CMD check and run testthat tests.

image: rocker/rstudio  
    - R -e 'install.packages(c("needed here"))'
    - R CMD build . --no-build-vignettes --no-manual
    - PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1)
    - R CMD check "${PKG_FILE_NAME}" --no-build-vignettes --no-manual
    - R -e 'devtools::test()'

To leave a comment for the author, please follow the link and comment on their blog: r - Brandon Bertelsen.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)