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
@@ -21,58 +29,53 @@ jobs:
21
29
- {os: macOS-latest, r: 'release'}
22
30
- {os: windows-latest, r: 'release'}
23
31
- {os: windows-latest, r: '3.6'}
24
- - {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" }
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.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/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"}
28
34
29
35
env :
30
- R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
31
36
RSPM : ${{ matrix.config.rspm }}
32
37
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
33
38
34
39
steps :
35
40
- uses : actions/checkout@v2
36
41
37
- - uses : r-lib/actions/setup-r@master
42
+ - uses : r-lib/actions/setup-r@v1
43
+ id : install-r
38
44
with :
39
45
r-version : ${{ matrix.config.r }}
40
46
http-user-agent : ${{ matrix.config.http-user-agent }}
41
47
42
- - uses : r-lib/actions/setup-pandoc@master
48
+ - uses : r-lib/actions/setup-pandoc@v1
43
49
44
- - name : Query dependencies
50
+ - name : Install pak and query dependencies
45
51
run : |
46
- install.packages('remotes')
47
- saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
48
- writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
52
+ install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
53
+ saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
49
54
shell : Rscript {0}
50
55
51
- - name : Cache R packages
52
- if : runner.os != 'Windows'
53
- uses : actions/cache@v1
56
+ - name : Restore R package cache
57
+ uses : actions/cache@v2
54
58
with :
55
59
path : ${{ env.R_LIBS_USER }}
56
- key : ${{ runner. os }}-${{ hashFiles('.github/R- version') }}-1-${{ hashFiles('.github/depends.Rds ') }}
57
- restore-keys : ${{ runner. os }}-${{ hashFiles('.github/R- version') }}-1-
60
+ key : ${{ matrix.config. os }}-${{ steps.install-r.outputs.installed-r- version }}-1-${{ hashFiles('.github/r- depends.rds ') }}
61
+ restore-keys : ${{ matrix.config. os }}-${{ steps.install-r.outputs.installed-r- version }}-1-
58
62
59
63
- name : Install system dependencies
60
64
if : runner.os == 'Linux'
61
65
run : |
62
- while read -r cmd
63
- do
64
- eval sudo $cmd
65
- done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "16.04"), sep = "\n")')
66
+ pak::local_system_requirements(execute = TRUE)
67
+ pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
68
+ shell : Rscript {0}
66
69
67
70
- name : Install dependencies
68
71
run : |
69
- remotes::install_deps(dependencies = TRUE)
70
- remotes::install_cran ("rcmdcheck")
72
+ pak::local_install_dev_deps(upgrade = TRUE)
73
+ pak::pkg_install ("rcmdcheck")
71
74
shell : Rscript {0}
72
75
73
76
- name : Install Miniconda
74
77
run : |
75
- Rscript -e "remotes::install_github ('rstudio/reticulate')"
78
+ Rscript -e "pak::pkg_install ('rstudio/reticulate')"
76
79
Rscript -e "reticulate::install_miniconda()"
77
80
78
81
- name : Find Miniconda on macOS
83
86
run : |
84
87
reticulate::conda_create('r-reticulate', packages = c('python==3.6.9'))
85
88
tensorflow::install_tensorflow(version='1.14.0')
86
- shell : Rscript {0}
89
+ shell : Rscript {0}
87
90
88
91
- name : Session info
89
92
run : |
95
98
- name : Check
96
99
env :
97
100
_R_CHECK_CRAN_INCOMING_ : false
98
- run : rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
101
+ run : |
102
+ options(crayon.enabled = TRUE)
103
+ rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
99
104
shell : Rscript {0}
100
105
101
106
- name : Show testthat output
@@ -107,5 +112,5 @@ jobs:
107
112
if : failure()
108
113
uses : actions/upload-artifact@main
109
114
with :
110
- name : ${{ runner .os }}-r${{ matrix.config.r }}-results
115
+ name : ${{ matrix.config .os }}-r${{ matrix.config.r }}-results
111
116
path : check
0 commit comments