GitHub Actions

In this lab, we will learn how to turn on continuous integration checking.

Goal: by the end of this lab, you should be able to automate checking for your GitHub package.

Continuous integration

Checking your software for errors on a variety of different platforms can help you make it more robust. To make this process automatic, we can use a cloud-based, continuous integration service like GitHub Actions.

GitHub Actions will run R CMD check on your package on a virtual machine instance running a plain version of Ubuntu. A new check will be triggered automatically every time you push a new commit to your GitHub repository.

To enable GitHub Actions checking, use the use_github_action() function from the usethis package.

use_github_action("check-release")

This will provide a template of the .github/workflows/R-CMD-check.yaml file that will control the behavior of GitHub Actions.

  1. Create a R-CMD-check.yaml file by running usethis::use_github_action("check-release").

Also, you can add a GitHub Actions badge to your README (that will be automatically updated). See the output in the Console for details

  1. Add the markdown code for the GitHub Actions badge to your README.Rmd file.

Since checking is triggered via GitHub, you have to push these files to the GitHub repository.

  1. Commit the .github/workflows/R-CMD-check.yaml file and the changes to the README files to GitHub.

Reflection

Please respond to the following prompt on Slack in the #questions channel.

Prompt: What questions do you still have about R packages? What would you like to discuss next week?