39  Actions: Testing Workflows

39.1 Setting up GitHub Actions workflows to check tests and test coverage

  1. Add the covr package as a suggested dependendency to your package via: usethis::use_package("covr", type = "Suggests")

  2. Add a GitHub Actions workflows that runs a comprehensive build check across the major operating systems and runs the test suite and calculates coverage via: usethis::use_github_action_check_standard() and usethis::use_github_action("test-coverage.yaml")

  3. Link your R package GitHub repo with codecov.io

  4. Copy the codecov.io token for that repo from codecov.io and add that as a GitHub Secret named CODECOV_TOKEN

  5. Add the codecov.io badge markdown syntax to your README.Rmd and knit to render the README.md file.

  6. Push your local changes to GitHub and sit back and watch the magic happen ✨

39.2 Setting up GitHub Actions workflows with R

The dev version of usethis has functions that will let you set-up your CI using GitHub Actions with ease! Here’s a quickstart guide below, and more details can be found in the Github actions with R book.

  1. Add the covr package as a suggested dependendency to your package via: usethis::use_package("covr", type = "Suggests")

  2. Add a GitHub Actions workflows that runs a comprehensive build check across the major operating systems and runs the test suite and calculates coverage via: usethis::use_github_action_check_standard() and usethis::use_github_action("test-coverage.yaml")

  3. Link your R package GitHub repo with codecov.io

  4. Copy the codecov.io token for that repo from codecov.io and add that as a GitHub Secret named CODECOV_TOKEN

  5. Add the codecov.io badge markdown syntax to your README.Rmd and knit to render the README.md file.

  6. Push your local changes to GitHub and sit back and watch the magic happen ✨

39.3 Additional resources:

39.3.1 Github actions with R book

39.3.2 GitHub Actions for the R community

39.3.3 GitHub Actions with Python

39.3.4 Curated list of awesome actions to use on GitHub πŸŽ‰