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
7
on :
2
8
push :
3
9
branches :
10
+ - main
4
11
- master
5
12
pull_request :
6
13
branches :
14
+ - main
7
15
- master
8
16
9
17
name : R-CMD-check
@@ -18,62 +26,81 @@ jobs:
18
26
fail-fast : false
19
27
matrix :
20
28
config :
21
- - { os: windows-latest, r: '3.6'}
22
- - { os: macOS-latest, r: '3.6'}
23
- - { os: macOS-latest, r: 'devel'}
24
- - { os: ubuntu-16.04, r: '3.2', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
25
- - { os: ubuntu-16.04, r: '3.3', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
26
- - { os: ubuntu-16.04, r: '3.4', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
27
- - { os: ubuntu-16.04, r: '3.5', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
28
- - { os: ubuntu-16.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
29
+ - {os: macOS-latest, r: 'release'}
30
+ - {os: windows-latest, r: 'release'}
31
+ - {os: windows-latest, r: '3.6'}
32
+ - {os: ubuntu-16.04, 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" }
33
+ - {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
34
+ - {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
35
+ - {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
36
+ - {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
37
+ - {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
29
38
30
39
env :
31
40
R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
32
- CRAN : ${{ matrix.config.cran }}
41
+ RSPM : ${{ matrix.config.rspm }}
42
+ GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
33
43
34
44
steps :
35
- - uses : actions/checkout@v1
45
+ - uses : actions/checkout@v2
36
46
37
- - uses : r-lib/actions/setup-r@master
47
+ - uses : r-lib/actions/setup-r@v1
38
48
with :
39
49
r-version : ${{ matrix.config.r }}
50
+ http-user-agent : ${{ matrix.config.http-user-agent }}
40
51
41
- - uses : r-lib/actions/setup-pandoc@master
52
+ - uses : r-lib/actions/setup-pandoc@v1
42
53
43
54
- name : Query dependencies
44
- run : Rscript -e "install.packages('remotes')" -e "saveRDS(remotes::dev_package_deps(dependencies = TRUE), 'depends.Rds', version = 2)"
55
+ run : |
56
+ install.packages('remotes')
57
+ saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
58
+ writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
59
+ shell : Rscript {0}
45
60
46
61
- name : Cache R packages
47
62
if : runner.os != 'Windows'
48
- uses : actions/cache@v1
63
+ uses : actions/cache@v2
49
64
with :
50
65
path : ${{ env.R_LIBS_USER }}
51
- key : ${{ runner.os }}-r- ${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }}
52
- restore-keys : ${{ runner.os }}-r- ${{ matrix.config.r }}-
66
+ key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- ${{ hashFiles('.github/ depends.Rds') }}
67
+ restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1 -
53
68
54
69
- name : Install system dependencies
55
70
if : runner.os == 'Linux'
56
- env :
57
- RHUB_PLATFORM : linux-x86_64-ubuntu-gcc
58
71
run : |
59
- Rscript -e "remotes::install_github('r-hub/sysreqs')"
60
- sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
61
- sudo -s eval "$sysreqs"
72
+ while read -r cmd
73
+ do
74
+ eval sudo $cmd
75
+ done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "16.04"))')
62
76
63
77
- name : Install dependencies
64
- run : Rscript -e "library(remotes)" -e "update(readRDS('depends.Rds'))" -e "remotes::install_cran('rcmdcheck')"
78
+ run : |
79
+ remotes::install_deps(dependencies = TRUE)
80
+ remotes::install_cran("rcmdcheck")
81
+ shell : Rscript {0}
82
+
83
+ - name : Session info
84
+ run : |
85
+ options(width = 100)
86
+ pkgs <- installed.packages()[, "Package"]
87
+ sessioninfo::session_info(pkgs, include_base = TRUE)
88
+ shell : Rscript {0}
65
89
66
90
- name : Check
67
- run : Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = 'check')"
91
+ env :
92
+ _R_CHECK_CRAN_INCOMING_ : false
93
+ run : rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
94
+ shell : Rscript {0}
95
+
96
+ - name : Show testthat output
97
+ if : always()
98
+ run : find check -name 'testthat.Rout*' -exec cat '{}' \; || true
99
+ shell : bash
68
100
69
101
- name : Upload check results
70
102
if : failure()
71
- uses : actions/upload-artifact@master
103
+ uses : actions/upload-artifact@main
72
104
with :
73
105
name : ${{ runner.os }}-r${{ matrix.config.r }}-results
74
106
path : check
75
-
76
- - name : Test coverage
77
- if : matrix.config.os == 'macOS-latest' && matrix.config.r == '3.6'
78
- run : |
79
- Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")'
0 commit comments