Skip to content
Git

CI/CD

Continuous Integration / Continuous Delivery (CI/CD) is a basic tool in today's Data Science toolstack to automate processes and execute repetitive tasks on schedule.

Running tasks in CI/CD should be fast and reliable, no matter the language, architecture or computing environment at hand. As CI/CD requires installing many packages over and over again, having binaries and optimized distributions helps to reduce runtime.

This page presents snippets for well-known and lesser-known CI/CD engines to help you get started with the R package binaries from this project.

GitHub Actions can be run directly on a VM or in a containerized context. The available VM images can be found here. The only Linux distribution available is Ubuntu.

For VM workflows, r-lib/actions provides many examples for different use cases.

To use package binaries from this project, use the following config for r-lib/actions/setup-r@v2:

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
Ncpus: 2
cran: 'https://cran.rpkgs.com/amd64/noble/latest'

(Ncpus: 2 has been set to allow for parallel installations.)

An alternative is to run Actions in a containerized context. This spins up a container of the selected image in the VM and allows running on other distributions than Ubuntu, e.g., on Alpine. To avoid having to install R and configure a custom repository each time, specialized images are provided that already have everything in place:

jobs:
container:
runs-on: ubuntu-latest
container: devxygmbh:r-alpine
steps:
- run: |
R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
R -q -e 'getOption("repos")'
R -q -e 'options(Ncpus = 2); pak::local_install_dev_deps()'

WIP