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.
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
43#
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
4+ # NOTE: This workflow is overkill for most R packages and
5+ # check-standard.yaml is likely a better choice.
6+ # usethis::use_github_action("check-standard") will install it.
77on :
88 push :
9- branches :
10- - main
11- - master
9+ branches : [main, master]
1210 pull_request :
13- branches :
14- - main
15- - master
11+ branches : [main, master]
1612
1713name : R-CMD-check
1814
@@ -27,86 +23,39 @@ jobs:
2723 matrix :
2824 config :
2925 - {os: macOS-latest, r: 'release'}
26+
3027 - {os: windows-latest, r: 'release'}
31- - {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"}
32- - {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.1.0 (ubuntu-18.04) R (4.1.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.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
36- - {os: ubuntu-18.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
37- - {os: ubuntu-18.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
28+ # Use 3.6 to trigger usage of RTools35
29+ - {os: windows-latest, r: '3.6'}
30+
31+ # Use older ubuntu to maximise backward compatibility
32+ - {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
33+ - {os: ubuntu-18.04, r: 'release'}
34+ - {os: ubuntu-18.04, r: 'oldrel-1'}
35+ - {os: ubuntu-18.04, r: 'oldrel-2'}
36+ - {os: ubuntu-18.04, r: 'oldrel-3'}
37+ - {os: ubuntu-18.04, r: 'oldrel-4'}
3838
3939 env :
40- RSPM : ${{ matrix.config.rspm }}
4140 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
41+ R_KEEP_PKG_SOURCE : yes
4242
4343 steps :
4444 - uses : actions/checkout@v2
4545
46- - uses : r-lib/actions/setup-r@v1
47- id : install-r
46+ - uses : r-lib/actions/setup-pandoc@v2
47+
48+ - uses : r-lib/actions/setup-r@v2
4849 with :
4950 r-version : ${{ matrix.config.r }}
5051 http-user-agent : ${{ matrix.config.http-user-agent }}
52+ use-public-rspm : true
5153
52- - uses : r-lib/actions/setup-pandoc@v1
53-
54- - name : Install pak and query dependencies
55- run : |
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")
58- shell : Rscript {0}
59-
60- - name : Restore R package cache
61- uses : actions/cache@v2
54+ - uses : r-lib/actions/setup-r-dependencies@v2
6255 with :
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-
56+ extra-packages : any::rcmdcheck
57+ needs : check
6858
69- - name : Install system dependencies
70- if : runner.os == 'Linux'
71- run : |
72- pak::local_system_requirements(execute = TRUE)
73- pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
74- shell : Rscript {0}
75-
76- - name : Install dependencies
77- run : |
78- pak::local_install_dev_deps(upgrade = TRUE)
79- pak::pkg_install("rcmdcheck")
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}
88-
89- - 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")
95- shell : 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-
102- - name : Upload check results
103- if : failure()
104- uses : actions/upload-artifact@main
59+ - uses : r-lib/actions/check-r-package@v2
10560 with :
106- name : ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
107- path : check
108-
109- - name : Don't use tar from old Rtools to store the cache
110- if : ${{ runner.os == 'Windows' && startsWith(steps.install-r.outputs.installed-r-version, '3.6' ) }}
111- shell : bash
112- run : echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH
61+ upload-snapshots : true
0 commit comments