1+ # NOTE: This workflow is overkill for most R packages
2+ # check-standard.yaml is likely a better choice
3+ # usethis::use_github_action("check-standard") will install it.
4+ #
5+ # For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
6+ # https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
17on :
28 push :
39 branches :
10+ - main
411 - master
512 pull_request :
613 branches :
14+ - main
715 - master
816
917name : R-CMD-check
@@ -21,54 +29,54 @@ jobs:
2129 - {os: macOS-latest, r: 'release'}
2230 - {os: windows-latest, r: 'release'}
2331 - {os: windows-latest, r: '3.6'}
24- - {os: ubuntu-16 .04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial /latest"}
25- - {os: ubuntu-16 .04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial /latest"}
26- - {os: ubuntu-16 .04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial /latest"}
27- - {os: ubuntu-16 .04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial /latest"}
28- - {os: ubuntu-16 .04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial /latest"}
29- - {os: ubuntu-16 .04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial /latest"}
32+ - {os: ubuntu-18 .04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic /latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
33+ - {os: ubuntu-18 .04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic /latest"}
34+ - {os: ubuntu-18 .04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic /latest"}
35+ - {os: ubuntu-18 .04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic /latest"}
36+ - {os: ubuntu-18 .04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic /latest"}
37+ - {os: ubuntu-18 .04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic /latest"}
3038
3139 env :
32- R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
3340 RSPM : ${{ matrix.config.rspm }}
3441 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
3542
3643 steps :
3744 - uses : actions/checkout@v2
3845
39- - uses : r-lib/actions/setup-r@master
46+ - uses : r-lib/actions/setup-r@v1
47+ id : install-r
4048 with :
4149 r-version : ${{ matrix.config.r }}
50+ http-user-agent : ${{ matrix.config.http-user-agent }}
4251
43- - uses : r-lib/actions/setup-pandoc@master
52+ - uses : r-lib/actions/setup-pandoc@v1
4453
45- - name : Query dependencies
54+ - name : Install pak and query dependencies
4655 run : |
47- install.packages('remotes')
48- saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
49- writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
56+ install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
57+ saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
5058 shell : Rscript {0}
5159
52- - name : Cache R packages
53- if : runner.os != 'Windows'
54- uses : actions/cache@v1
60+ - name : Restore R package cache
61+ uses : actions/cache@v2
5562 with :
56- path : ${{ env.R_LIBS_USER }}
57- key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
58- restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
63+ path : |
64+ ${{ env.R_LIBS_USER }}
65+ !${{ env.R_LIBS_USER }}/pak
66+ key : ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
67+ restore-keys : ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
5968
6069 - name : Install system dependencies
6170 if : runner.os == 'Linux'
6271 run : |
63- while read -r cmd
64- do
65- eval sudo $cmd
66- done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "16.04"), sep = "\n")')
72+ pak::local_system_requirements(execute = TRUE)
73+ pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
74+ shell : Rscript {0}
6775
6876 - name : Install dependencies
6977 run : |
70- remotes::install_deps(dependencies = TRUE)
71- remotes::install_cran ("rcmdcheck")
78+ pak::local_install_dev_deps(upgrade = TRUE)
79+ pak::pkg_install ("rcmdcheck")
7280 shell : Rscript {0}
7381
7482 - name : Session info
8189 - name : Check
8290 env :
8391 _R_CHECK_CRAN_INCOMING_ : false
84- run : rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
92+ run : |
93+ options(crayon.enabled = TRUE)
94+ rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
8595 shell : Rscript {0}
8696
8797 - name : Show testthat output
93103 if : failure()
94104 uses : actions/upload-artifact@main
95105 with :
96- name : ${{ runner .os }}-r${{ matrix.config.r }}-results
106+ name : ${{ matrix.config .os }}-r${{ matrix.config.r }}-results
97107 path : check
0 commit comments