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
@@ -18,29 +26,30 @@ jobs:
1826 fail-fast : false
1927 matrix :
2028 config :
21- - {os: macOS-latest, r: 'devel'}
2229 - {os: macOS-latest, r: 'release'}
2330 - {os: windows-latest, r: 'release'}
24- - {os: windows-latest, r: 'oldrel'}
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.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
28- - {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
29- - {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
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.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.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"}
3038
3139 env :
3240 R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
3341 RSPM : ${{ matrix.config.rspm }}
3442 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
35- _R_CHECK_FORCE_SUGGESTS_ : false
43+
3644 steps :
3745 - uses : actions/checkout@v2
3846
39- - uses : r-lib/actions/setup-r@master
47+ - uses : r-lib/actions/setup-r@v1
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
4554 - name : Query dependencies
4655 run : |
@@ -49,22 +58,20 @@ jobs:
4958 writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
5059 shell : Rscript {0}
5160
52- - name : Cache R packages
53- if : runner.os != 'Windows'
54- uses : actions/cache@v1
61+ - name : Restore R package cache
62+ uses : actions/cache@v2
5563 with :
5664 path : ${{ env.R_LIBS_USER }}
5765 key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
5866 restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
5967
6068 - name : Install system dependencies
6169 if : runner.os == 'Linux'
62- env :
63- RHUB_PLATFORM : linux-x86_64-ubuntu-gcc
6470 run : |
65- Rscript -e "remotes::install_github('r-hub/sysreqs')"
66- sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
67- sudo -s eval "$sysreqs"
71+ while read -r cmd
72+ do
73+ eval sudo $cmd
74+ done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "18.04"))')
6875
6976 - name : Install dependencies
7077 run : |
8289 - name : Check
8390 env :
8491 _R_CHECK_CRAN_INCOMING_ : false
85- run : rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
92+ _R_CHECK_FORCE_SUGGESTS_ : false
93+ run : |
94+ options(crayon.enabled = TRUE)
95+ rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
8696 shell : Rscript {0}
8797
8898 - name : Show testthat output
@@ -92,7 +102,12 @@ jobs:
92102
93103 - name : Upload check results
94104 if : failure()
95- uses : actions/upload-artifact@master
105+ uses : actions/upload-artifact@main
96106 with :
97107 name : ${{ runner.os }}-r${{ matrix.config.r }}-results
98108 path : check
109+
110+ - name : Don't use tar from old Rtools to store the cache
111+ if : ${{ runner.os == 'Windows' && startsWith(steps.install-r.outputs.installed-r-version, '3.6' ) }}
112+ shell : bash
113+ run : echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH
0 commit comments