GitLab CI/CD: pipeline for the R package avidaR

GitLab CI/CD: pipeline for the R package avidaR

We have created a Pipeline for the R package avidaR which is launched every time we upload some changes to our GitLab remote repository (i.e., when a push command is executed from our local repository or a commit is sent from the GiLab graphical user interface). This Pipeline is defined here.


The pipeline is organized in three independent stages:

  • test: avidaR is installed from GitLab, tests are run on it, and the coverage test tool is executed. No artifacts are stored.
  • build: the package is built without vignettes and manual, and the R CMD check is run. The package tar-ball is stored as an artifact for later downloads.
  • check: CMD check --as-cran is executed. No artifacts are stored.


We can take a look at avidaR repository --> main menu -> CI/CD -> Pipelines to monitor the Pipeline status.


If any o these stages is unsuccessfully executed, we can review it to get information about bugs or notes.

monitor log

Otherwise we can continue developing and updating our source code as usual. This is useful to avoid checking our code manually every time we do an update, leaving to the end the task of checking it before submitting to CRAN.

The pipeline can be improved by publishing/sending the logs and reports to the maintainers for checking.

Note: By default, only 400 minutes of CPU execution are available for the pipelines in GitLab. When this time is reached, GitLab will suggest ... to buy more time.


The tar-ball file of the package stored at the public folder during the building stage can be downloaded to install, check, or submit it to the CRAN repository.

donwload artifacts


What are badges?

"Badges are a unified way to present condensed pieces of information about your projects. They consist of a small image and a URL that the image points to. Examples for badges can be the pipeline status, test coverage, latest release, or ways to contact the project maintainers ...".

Read here more about badges.


Pipeline status and code coverage percentage badges are populated with data extracted from the pipeline output logs created during execution.

Note: CRAN and Downloads badges are populate from the CRAN API. At the time of writing this document, avidaR package is still in development process and has not yet been sent to the CRAN repository.


In order to show the badges it in the file, we have added the following code at the top of the document:

<!-- badges: start -->

[![pipeline status](]( [![coverage report](]( [![Version on
CRAN](]( [![Total downloads on

<!-- badges: end -->


In the repository menu -> CI/CD -> Editor, add the keyword coverage and set its value:

Test coverage parsing

Then, click on the Commit Changes button.

Finally, we browse/refresh the file to check out that the coverage percentage is updated.

Note: Value coverage percentage is captured from the output generated by R -e 'covr::package_coverage()' command at test stage.

avidaR Coverage
Show Comments