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
or devel
branches, and pull
requests targeting these branches.
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
-
error-on
: Input for the ‘error_on’ parameter inrcmdcheck::rcmdcheck()
. Defaults to ‘note’.
Steps
- Get branch names: Extracts branch names.
- Checkout repo: Checks out the repository based on the event type (push or pull request).
- Restore cache: Restores cached dependencies.
- Run Staged dependencies: Executes staged dependencies action.
- Install dependencies from DESCRIPTION: install dependencies from DESCRIPTION (in case of missing dependencies in parent admiralci docker image)
-
Upload dependencies artifacts: Create
renv.lock
anddeps.csv
file (containing docker image dependencies) -
Upload deps.csv and renv.lock artifacts: Upload
renv.lock
anddeps.csv
files as artifacts. - Check Version: Determines if the package has a maintenance version.
-
Check: Performs R CMD checks using
rcmdcheck::rcmdcheck()
. - Upload check results: Uploads check results as an artifact in case of failure.
Inputs
Triggers
-
workflow_dispatch
: Allows manual triggering of the workflow. -
workflow_call
: Triggered by a workflow call event. -
push
: Triggered on pushes to themain
ordevel
branches. -
pull_request
: Triggered on pull requests targeting themain
ordevel
branches.
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/)