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- - master
5+ branches : [main, master]
116 pull_request :
12- branches :
13- - master
7+ branches : [main, master]
148
15- name : R-CMD-check
9+ name : R-CMD-check.yaml
10+
11+ permissions : read-all
1612
1713jobs :
1814 R-CMD-check :
@@ -24,85 +20,33 @@ jobs:
2420 fail-fast : false
2521 matrix :
2622 config :
27- - {os: macOS-latest, cov: 'true', r: 'release'}
28- - {os: windows-latest,cov: 'false', r: 'release'}
29- - {os: windows-latest,cov: 'false', r: '3.6'}
30- - {os: ubuntu-16.04, cov: 'false', r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest", http-user-agent: "R/4.0.0 (ubuntu-16.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
31- - {os: ubuntu-16.04, cov: 'false', r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
32- - {os: ubuntu-16.04, cov: 'false', r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
33- - {os: ubuntu-16.04, cov: 'false', r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
34- - {os: ubuntu-16.04, cov: 'false', r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
23+ - {os: macos-latest, r: 'release'}
24+ - {os: windows-latest, r: 'release'}
25+ - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
26+ - {os: ubuntu-latest, r: 'release'}
27+ - {os: ubuntu-latest, r: 'oldrel-1'}
3528
3629 env :
37- R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
38- RSPM : ${{ matrix.config.rspm }}
3930 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
31+ R_KEEP_PKG_SOURCE : yes
4032
4133 steps :
42- - uses : actions/checkout@v2
34+ - uses : actions/checkout@v4
35+
36+ - uses : r-lib/actions/setup-pandoc@v2
4337
44- - uses : r-lib/actions/setup-r@master
38+ - uses : r-lib/actions/setup-r@v2
4539 with :
4640 r-version : ${{ matrix.config.r }}
4741 http-user-agent : ${{ matrix.config.http-user-agent }}
42+ use-public-rspm : true
4843
49- - uses : r-lib/actions/setup-pandoc@master
50-
51- - name : Query dependencies
52- run : |
53- install.packages('remotes')
54- saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
55- writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
56- shell : Rscript {0}
57-
58- - name : Cache R packages
59- if : runner.os != 'Windows'
60- uses : actions/cache@v1
44+ - uses : r-lib/actions/setup-r-dependencies@v2
6145 with :
62- path : ${{ env.R_LIBS_USER }}
63- key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
64- restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
65-
66- - name : Install system dependencies
67- if : runner.os == 'Linux'
68- run : |
69- while read -r cmd
70- do
71- eval sudo $cmd
72- done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "16.04"), sep = "\n")')
73-
74- - name : Install dependencies
75- run : |
76- remotes::install_deps(dependencies = TRUE)
77- remotes::install_cran("rcmdcheck")
78- shell : Rscript {0}
79-
80- - name : Session info
81- run : |
82- options(width = 100)
83- pkgs <- installed.packages()[, "Package"]
84- sessioninfo::session_info(pkgs, include_base = TRUE)
85- shell : Rscript {0}
86-
87- - name : Check
88- env :
89- _R_CHECK_CRAN_INCOMING_ : false
90- run : rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
91- shell : Rscript {0}
92-
93- - name : Show testthat output
94- if : always()
95- run : find check -name 'testthat.Rout*' -exec cat '{}' \; || true
96- shell : bash
97-
98- - name : Cover
99- if : matrix.config.cov == 'true'
100- run : covr::codecov()
101- shell : Rscript {0}
46+ extra-packages : any::rcmdcheck
47+ needs : check
10248
103- - name : Upload check results
104- if : failure()
105- uses : actions/upload-artifact@main
49+ - uses : r-lib/actions/check-r-package@v2
10650 with :
107- name : ${{ runner.os }}-r${{ matrix.config.r }}-results
108- path : check
51+ upload-snapshots : true
52+ build_args : ' c("--no-manual","--compact-vignettes=gs+qpdf") '
0 commit comments