Skip to contents

Sets up a GitHub Actions workflow that calculates and reports test coverage:

  • uses covr::package_coverage().

  • on a pull request:

    • calculates test coverage for head.

    • builds a badge (for use in the commit message).

    • initialises or switches to the covr2gh-storage branch.

    • switches to base branch and calculates test coverage.

    • compares coverage for head and base and posts a comment with the main findings.

    • uploads base coverage and badge as artefacts.

    • posts a workflow summary.

  • on a push to main:

    • calculates test coverage for head and creates a badge.

    • switches to or creates the covr2gh-storage branch.

    • commits badge (referenced in the README).

Usage

use_covr2gh_action(badge = TRUE)

Arguments

badge

(logical) should a badge be added to README? Defaults to TRUE.

Details

use_covr2gh_action() wraps usethis::use_github_action().

Examples

if (FALSE) { # \dontrun{
use_covr2gh_action()
} # }