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
1+ # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
73on :
84 push :
9- branches :
10- - main
11- - master
5+ branches : [main, master]
126 pull_request :
13- branches :
14- - main
15- - master
167
17- name : R-CMD-check
8+ name : R-CMD-check.yaml
9+
10+ permissions : read-all
1811
1912jobs :
2013 R-CMD-check :
@@ -26,75 +19,33 @@ jobs:
2619 fail-fast : false
2720 matrix :
2821 config :
29- - {os: macOS -latest, r: 'release'}
22+ - {os: macos -latest, r: 'release'}
3023 - {os: windows-latest, r: 'release'}
31- - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
32- - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/release", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions"}
24+ - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+ - {os: ubuntu-latest, r: 'release'}
26+ - {os: ubuntu-latest, r: 'oldrel-1'}
3327
3428 env :
35- RSPM : ${{ matrix.config.rspm }}
3629 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
30+ R_KEEP_PKG_SOURCE : yes
3731
3832 steps :
39- - uses : actions/checkout@v2
33+ - uses : actions/checkout@v4
34+
35+ - uses : r-lib/actions/setup-pandoc@v2
4036
41- - uses : r-lib/actions/setup-r@v2-branch
42- id : install-r
37+ - uses : r-lib/actions/setup-r@v2
4338 with :
4439 r-version : ${{ matrix.config.r }}
4540 http-user-agent : ${{ matrix.config.http-user-agent }}
41+ use-public-rspm : true
4642
47- - uses : r-lib/actions/setup-pandoc@v1
48-
49- - name : Install pak and query dependencies
50- run : |
51- install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
52- saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
53- shell : Rscript {0}
54-
55- - name : Cache R packages
56- uses : actions/cache@v2
43+ - uses : r-lib/actions/setup-r-dependencies@v2
5744 with :
58- path : ${{ env.R_LIBS_USER }}
59- key : ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
60- restore-keys : ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
61-
62- - name : Install system dependencies
63- if : runner.os == 'Linux'
64- run : |
65- pak::local_system_requirements(execute = TRUE)
66- pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
67- shell : Rscript {0}
68-
69- - name : Install dependencies
70- run : |
71- pak::local_install_dev_deps(upgrade = TRUE)
72- pak::pkg_install("rcmdcheck")
73- shell : Rscript {0}
74-
75- - name : Session info
76- run : |
77- options(width = 100)
78- pkgs <- installed.packages()[, "Package"]
79- sessioninfo::session_info(pkgs, include_base = TRUE)
80- shell : Rscript {0}
81-
82- - name : Check
83- env :
84- _R_CHECK_CRAN_INCOMING_ : false
85- run : |
86- options(crayon.enabled = TRUE)
87- rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
88- shell : Rscript {0}
89-
90- - name : Show testthat output
91- if : always()
92- run : find check -name 'testthat.Rout*' -exec cat '{}' \; || true
93- shell : bash
45+ extra-packages : any::rcmdcheck
46+ needs : check
9447
95- - name : Upload check results
96- if : failure()
97- uses : actions/upload-artifact@main
48+ - uses : r-lib/actions/check-r-package@v2
9849 with :
99- name : ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
100- path : check
50+ upload-snapshots : true
51+ build_args : ' c("--no-manual","--compact-vignettes=gs+qpdf") '
0 commit comments