forked from hadley/r-pkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontinuous-integration.Rmd
39 lines (24 loc) · 1.48 KB
/
continuous-integration.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Continuous integration {#sec-ci}
```{r, echo = FALSE}
source("common.R")
status("drafting")
```
## Introduction
## Checking after every commit with GitHub actions {#sec-gha}
If you're using GitHub, as we recommend, you should also use GitHub Actions.
GitHub Actions allow you to run code every time you push to GitHub.
To use GitHub Actions:
1. Run `usethis::use_github_action_check_standard()` to set up a GitHub Action that runs `R CMD check` on Linux, Mac, and Windows.
Literally, this adds a new file to your package, below `.github/workflows/.`
2. Commit this new file and push to GitHub.
3. Wait a few minutes to see the results in your email.
With this setup in place, `R CMD check` will be run every time you push to GitHub or whenever someone submits a pull request.
You'll find out about failures right away, which makes them easier to fix.
Using automated checks also encourages me to check more often locally, because I know if it fails I'll find out about it a few minutes later, often once I've moved on to a new problem.
### Other uses
Since GitHub Actions allows you to run arbitrary code, there are many other things that you can use it for:
- Re-publishing a book website every time you make a change to the source.
(Like this book!)
- Building vignettes and publishing them to a website.
- Automatically building a documentation website for your package.
Learn more about using GitHub Actions with R at <https://github.com/r-lib/actions/tree/master/examples>.