-
Notifications
You must be signed in to change notification settings - Fork 3
211 lines (176 loc) · 6.06 KB
/
R-CMD-check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on:
push:
branches-ignore: [gh-pages]
pull_request:
branches-ignore: [gh-pages]
name: R-CMD-check
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
_R_CHECK_FORCE_SUGGESTS_: false
_R_CHECK_CRAN_INCOMING_REMOTE_: false
jobs:
R-CMD-check:
if: "! contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ${{ matrix.config.os }}
name: Check ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-22.04, r: 'release'}
- {os: ubuntu-20.04, r: '3.6'}
# Use latest ubuntu to make it easier to install dependencies
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Disable autocrlf
run: git config --global core.autocrlf false
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::remotes, any::rcmdcheck
needs: check
cache-version: 1
- name: Install latex
uses: r-lib/actions/setup-tinytex@v2
env:
# https://github.com/rstudio/tinytex-releases#releases
TINYTEX_INSTALLER: TinyTeX-0
- name: Install latex packages
run: |
remotes::install_cran("tinytex")
tinytex::tlmgr_install("pdfcrop")
shell: Rscript {0}
- name: Install macos dependencies
if: runner.os == 'macOS'
run: brew install gsl gawk automake
- name: Check (CRAN)
env:
NOT_CRAN: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- name: Check (NOT CRAN)
if: success()
env:
NOT_CRAN: true
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--run-donttest", "--run-dontrun", "--timings"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- name: Show testthat output
if: failure()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Install package
run: |
remotes::install_local(".", force = TRUE, upgrade = "never", build_manual = TRUE, build_vignettes = TRUE)
shell: Rscript {0}
- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
rchk:
needs: R-CMD-check
name: rchk ${{ matrix.config.os }} (${{ matrix.config.r }})
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {os: ubuntu-latest, r: 'release'}
container:
image: rhub/ubuntu-rchk
options: --user=root
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/run-rchk@v2
with:
setup-only: true
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, local::.
needs: check
- uses: r-lib/actions/run-rchk@v2
with:
run-only: true
coverage:
needs: rchk
name: Coverage ${{ matrix.config.os }} (${{ matrix.config.r }})
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {os: ubuntu-latest, r: 'release'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage
- name: Test coverage
env:
NOT_CRAN: false
run: |
covr::codecov(type="all", quiet=FALSE, commentDonttest = FALSE, commentDontrun = FALSE)
shell: Rscript {0}
pkgdown:
needs: R-CMD-check
if: contains('
refs/heads/master
refs/heads/main
', github.ref) && github.event_name == 'push'
name: pkgdown ${{ matrix.config.os }} (${{ matrix.config.r }})
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, r: 'release'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website
- name: Deploy package
if: success() && runner.os == 'Linux' && matrix.config.r == 'release' && github.event_name == 'push'
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, run_dont_run = TRUE)'
shell: bash {0}