Skip to contents

R CMD Check Workflow

This GitHub Actions workflow performs R CMD checks on specified R versions and repositories. The checks are triggered by manual dispatch, pushes to the main branch, and pull requests targeting this branch.

Workflow Structure

The workflow consists of a single job: R-CMD-check.

R-CMD-check Job

This job runs R CMD checks on different R versions, leveraging specified CRAN repositories. The job is conditioned not to run if the commit message contains ‘[skip r-cmd-check]’. The checks are performed in parallel for each specified R version, using Matrix Strategy. Artifacts are also produced for each R version from the matrix (renv.lock and deps.csv). Developers can download these artifacts in the Action summary page to be able to ensure reproducibility (having exactly the same dependencies versions locally).

Inputs
Steps
  1. Get branch names: Extracts branch names.
  2. Checkout repo: Checks out the repository based on the event type (push or pull request).
  3. Restore cache: Restores cached dependencies.
  4. Run Staged dependencies: Executes staged dependencies action.
  5. Install dependencies from DESCRIPTION: install dependencies from DESCRIPTION (in case of missing dependencies in parent admiralci docker image)
  6. Upload dependencies artifacts: Create renv.lock and deps.csv file (containing docker image dependencies)
  7. Upload deps.csv and renv.lock artifacts: Upload renv.lock and deps.csv files as artifacts.
  8. Check Version: Determines if the package has a maintenance version.
  9. Check: Performs R CMD checks using rcmdcheck::rcmdcheck().
  10. Upload check results: Uploads check results as an artifact in case of failure.

Concurrency

Concurrency settings are specified to manage concurrent workflow runs effectively.

Inputs

Triggers

  • workflow_dispatch: Allows manual triggering of the workflow.
  • workflow_call: Triggered by a workflow call event.
  • push: Triggered on pushes to the main branch.
  • pull_request: Triggered on pull requests targeting the main branch.

Matrix

  • The workflow runs on admiralci docker images (depending on the matrix element r version).
  • R versions are specified in the matrix for parallel execution.
matrix:
  r_version: ['release', 'devel', 'oldrel']

Note: We will change soon the repos element to use CRAN repo (https://cran.r-project.org/)

Permissions

  • write-all: Provides write permissions for various operations.

Note: It’s possible to ignore some folders/files during build process, using .Rbuildignore file.