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/master/examples
2
+ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
4
3
#
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.
7
7
on :
8
8
push :
9
- branches :
10
- - main
11
- - master
9
+ branches : [main, master]
12
10
pull_request :
13
- branches :
14
- - main
15
- - master
11
+ branches : [main, master]
16
12
17
13
name : R-CMD-check
18
14
@@ -27,62 +23,41 @@ jobs:
27
23
matrix :
28
24
config :
29
25
- {os: macOS-latest, r: 'release'}
26
+
30
27
- {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"}
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
36
37
37
env :
38
- RSPM : ${{ matrix.config.rspm }}
39
38
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
39
+ R_KEEP_PKG_SOURCE : yes
40
40
41
41
steps :
42
42
- uses : actions/checkout@v2
43
43
44
+ - uses : r-lib/actions/setup-pandoc@v1
45
+
44
46
- uses : r-lib/actions/setup-r@v1
45
- id : install-r
46
47
with :
47
48
r-version : ${{ matrix.config.r }}
48
49
http-user-agent : ${{ matrix.config.http-user-agent }}
50
+ use-public-rspm : true
49
51
50
- - uses : r-lib/actions/setup-pandoc@v1
51
-
52
- - name : Install pak and query dependencies
53
- run : |
54
- install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
55
- saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
56
- shell : Rscript {0}
57
-
58
- - name : Restore R package cache
59
- uses : actions/cache@v2
52
+ - uses : r-lib/actions/setup-r-dependencies@v1
60
53
with :
61
- path : |
62
- ${{ env.R_LIBS_USER }}/*
63
- !${{ env.R_LIBS_USER }}/pak
64
- key : ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
65
- restore-keys : ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
66
-
67
- - name : Install system dependencies
68
- if : runner.os == 'Linux'
69
- run : |
70
- pak::local_system_requirements(execute = TRUE)
71
- pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
72
- pak::pkg_system_requirements("textshaping", execute = TRUE)
73
- pak::pkg_system_requirements("gert", 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}
54
+ extra-packages : rcmdcheck
81
55
82
56
- name : Install Miniconda
83
57
run : |
84
- Rscript -e "pak::pkg_install('rstudio/reticulate')"
85
- Rscript -e "reticulate::install_miniconda()"
58
+ pak::pkg_install('rstudio/reticulate')
59
+ reticulate::install_miniconda()
60
+ shell : Rscript {0}
86
61
87
62
- name : Find Miniconda on macOS
88
63
if : runner.os == 'macOS'
94
69
tensorflow::install_tensorflow(version='1.14.0')
95
70
shell : Rscript {0}
96
71
97
- - name : Session info
98
- run : |
99
- options(width = 100)
100
- pkgs <- installed.packages()[, "Package"]
101
- sessioninfo::session_info(pkgs, include_base = TRUE)
102
- shell : Rscript {0}
103
-
104
- - name : Check
105
- env :
106
- _R_CHECK_CRAN_INCOMING_ : false
107
- run : |
108
- options(crayon.enabled = TRUE)
109
- rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
110
- shell : Rscript {0}
72
+ - uses : r-lib/actions/check-r-package@v1
111
73
112
74
- name : Show testthat output
113
75
if : always()
@@ -118,10 +80,5 @@ jobs:
118
80
if : failure()
119
81
uses : actions/upload-artifact@main
120
82
with :
121
- name : ${{ matrix.config .os }}-r${{ matrix.config.r }}-results
83
+ name : ${{ runner .os }}-r${{ matrix.config.r }}-results
122
84
path : check
123
-
124
- - name : Don't use tar from old Rtools to store the cache
125
- if : ${{ runner.os == 'Windows' && startsWith(steps.install-r.outputs.installed-r-version, '3.6' ) }}
126
- shell : bash
127
- run : echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH
0 commit comments