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
71on :
82push :
9- branches :
10- -main
11- -master
3+ branches :[main, master]
124pull_request :
13- branches :
14- -main
15- -master
5+ branches :[main, master]
166
17- name :R- CMD-check
7+ name :R CMD Check
188
199jobs :
2010R-CMD-check :
@@ -28,80 +18,36 @@ jobs:
2818config :
2919 -{os: macOS-latest, r: 'release'}
3020 -{os: windows-latest, r: 'release'}
31- -{os: windows-latest, r: '3.6'}
32- -{os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
33- -{os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
34- -{os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
35- -{os: ubuntu-20.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
21+ -{os: ubuntu-latest, r: 'release'}
22+
3623env :
37- R_REMOTES_NO_ERRORS_FROM_WARNINGS :true
38- RSPM :${{ matrix.config.rspm }}
3924GITHUB_PAT :${{ secrets.GITHUB_TOKEN }}
25+ R_KEEP_PKG_SOURCE :yes
4026
4127steps :
4228 -uses :actions/checkout@v2
4329
44- -uses :r-lib/actions/setup-r@v1
30+ -uses :r-lib/actions/setup-r@v2
4531with :
4632r-version :${{ matrix.config.r }}
4733http-user-agent :${{ matrix.config.http-user-agent }}
34+ use-public-rspm :true
4835
49- -uses :r-lib/actions/setup-pandoc@v1
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 :Restore R package cache
59- if :runner.os != 'Windows'
60- uses :actions/cache@v2
36+ -uses :r-lib/actions/setup-r-dependencies@v2
6137with :
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 'writeLines(remotes::system_requirements("ubuntu", "16.04"))')
73-
74- -name :Install dependencies
75- run :|
76- remotes::install_deps(dependencies = TRUE)
77- remotes::install_github("r-spatial/sf", configure.args = "--with-proj-lib=/usr/local/lib/")
78- remotes::install_cran("rcmdcheck")
79- remotes::install_cran("sessioninfo")
80- shell :Rscript {0}
81-
82- -name :Session info
83- run :|
84- options(width = 100)
85- pkgs <- installed.packages()[, "Package"]
86- sessioninfo::session_info(pkgs, include_base = TRUE)
87- shell :Rscript {0}
38+ extra-packages :any::rcmdcheck
39+ needs :check
8840
8941 -name :Check
90- env :
91- _R_CHECK_CRAN_INCOMING_ :false
92- run :|
93- options(crayon.enabled = TRUE)
94- rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
42+ run :rcmdcheck::rcmdcheck(args = c("--ignore-vignettes", "--no-manual", "--no-tests"),
43+ build_args = c("--no-build-vignettes"),
44+ error_on = "error",
45+ check_dir = "check")
9546shell :Rscript {0}
96-
97- -name :Show testthat output
98- if :always()
99- run :find check -name 'testthat.Rout*' -exec cat '{}' \; || true
100- shell :bash
101-
47+
10248 -name :Upload check results
10349if :failure()
104- uses :actions/upload-artifact@main
50+ uses :actions/upload-artifact@master
10551with :
106- name :${{ runner.os }}-r${{ matrix.config.r }}- results
52+ name :results
10753path :check