This workflow calculates coverage using the covr package, then creates summaries to post as a GitHub action summary or as pull request comment. All data remains in the GitHub repository.

use_calc_cov_summaries(
  workflow_name = "call-calc-cov-summaries.yml",
  build_trigger = "pull_request",
  use_public_rspm = TRUE,
  depends_on_quarto = FALSE,
  tag_ghactions4r = NULL
)

Arguments

workflow_name

What to name the github action workflow locally. Must have the file extension .yml

build_trigger

Select the event that triggers the workflow. Options are:

pull_request

Run when a pull request is opened, reopened, or updated (default)

push_to_main

Run on pushing commits to main

push_to_all_branches

Run on pushing commits to any branch

manually

run manually with the workflow_dispatch trigger

Multiple build triggers are allowed; specify them as a vector. Note that invalid build triggers will be silently removed as long as one build trigger is specified correctly.

use_public_rspm

Use posit package manager instead of CRAN to install dependencies? The advantage here is that dependencies are precompiled, so install should be much quicker. In rare situations (like packages with TMB dependencies), using use_public_rspm = FALSE may be a better option. Note a setting only needs to be specified in the yml if use_public_rspm is FALSE, so there will be no setting added if use_public_rspm is TRUE.

depends_on_quarto

Adds an option that installs quarto as a dependency.

tag_ghactions4r

Tag of ghactions4r workflow to pin to for the reusable workflow. This ensures compatibility with a specific version of ghactions4r functions. The tradeoff is that fixes will not happen automatically; instead, the user will have to update the pinned version of the caller workflow used. See the options by looking at the ghactions4r tags. Another option is to pin to commit hashes, but the user will need to do this by manually editing the caller workflow after creation. See github documentation on security to understand how this is more secure. Again, the tradeoff is that the workflow will not be automatically updated.