20.3 CI/CD

For a package:

  1. Source package in GH
    • Multiple developers have permissions to push
    • External can push via PR
  2. Main idea: development tasks can be executed automatically when certain events happens

Example: Automate R CMD check

20.3.1 More!!! GitHub Action (GHA)

usethis have function that copy some GHA workflow into a specific folder .github.

You have a curated already made workflow here : https://github.com/r-lib/actions/#readme

When using usethi::use_github_action_check_standard

#> ✔ Creating '.github/'
#> ✔ Adding '*.html' to '.github/.gitignore'
#> ✔ Creating '.github/workflows/'
#> ✔ Saving 'r-lib/actions/examples/check-standard.yaml@v2' to .github/workflows/R-CMD-check.yaml'
#> • Learn more at <https://github.com/r-lib/actions/blob/v2/examples/README.md>.
#> ✔ Adding R-CMD-check badge to 'README.md'```
  • Create .github/workflow/

  • Add new needed lines in .gitignore

  • Add a shiny badge at the top of your README.md

It has plenty of other uses!

  • usethis::use_pkgdown_github_page()

  • usethis::use_github_action("test_covergae")