1- # For help debugging build failures open an issue on the RStudio community with the ' github- actions' tag.
2- # https://community.rstudio. com/new-topic?category=Package%20development&tags=github- actions
1+ # Workflow derived from https:// github.com/r-lib/ actions/tree/master/examples
2+ # Need help debugging build failures? Start at https://github. com/r-lib/ actions#where-to-find-help
33on :
44 push :
5- branches :
6- - master
5+ branches : [main, master]
76 pull_request :
8- branches :
9- - master
7+ branches : [main, master]
108
119name : R-CMD-check
1210
@@ -20,58 +18,36 @@ jobs:
2018 fail-fast : false
2119 matrix :
2220 config :
21+ - {os: macOS-latest, r: 'release'}
2322 - {os: windows-latest, r: 'release'}
24- - {os: macOS-latest, r: 'release'}
25- - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
26- - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
23+ - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
24+ - {os: ubuntu-latest, r: 'release'}
2725
2826 env :
29- R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
30- RSPM : ${{ matrix.config.rspm }}
27+ GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
28+ R_KEEP_PKG_SOURCE : yes
3129
3230 steps :
3331 - uses : actions/checkout@v2
3432
33+ - uses : r-lib/actions/setup-pandoc@master
34+
3535 - uses : r-lib/actions/setup-r@master
3636 with :
3737 r-version : ${{ matrix.config.r }}
38+ http-user-agent : ${{ matrix.config.http-user-agent }}
39+ use-public-rspm : true
3840
39- - uses : r-lib/actions/setup-pandoc@master
40-
41- - name : Query dependencies
42- run : |
43- install.packages('remotes')
44- saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
45- writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
46- shell : Rscript {0}
47-
48- - name : Cache R packages
49- if : runner.os != 'Windows'
50- uses : actions/cache@v1
41+ - uses : r-lib/actions/setup-r-dependencies@master
5142 with :
52- path : ${{ env.R_LIBS_USER }}
53- key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }}
54- restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2-
55-
56- - name : Install system dependencies
57- if : runner.os == 'Linux'
58- run : |
59- while read -r cmd
60- do
61- eval sudo $cmd
62- done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
43+ extra-packages : rcmdcheck
6344
64- - name : Install dependencies
65- run : |
66- remotes::install_deps(dependencies = TRUE)
67- remotes::install_cran("rcmdcheck")
68- shell : Rscript {0}
45+ - uses : r-lib/actions/check-r-package@master
6946
70- - name : Check
71- env :
72- _R_CHECK_CRAN_INCOMING_REMOTE_ : false
73- run : rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
74- shell : Rscript {0}
47+ - name : Show testthat output
48+ if : always()
49+ run : find check -name 'testthat.Rout*' -exec cat '{}' \; || true
50+ shell : bash
7551
7652 - name : Upload check results
7753 if : failure()
0 commit comments