-
Notifications
You must be signed in to change notification settings - Fork 2
258 lines (200 loc) · 7.52 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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# NOTE: This workflow is overkill for most R packages and
# check-standard.yaml is likely a better choice.
# usethis::use_github_action("check-standard") will install it.
on:
push:
branches:
- main
- master
- release
- cran-*
pull_request:
branches:
- main
- master
workflow_dispatch:
inputs:
ref:
description: "Branch or tag to check out"
required: false
default: "main"
merge_group:
types:
- checks_requested
schedule:
- cron: "10 0 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.ref || github.head_ref || github.sha }}-${{ github.base_ref || '' }}
cancel-in-progress: true
name: rcc
jobs:
rcc-smoke:
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.commit.outputs.sha }}
versions-matrix: ${{ steps.versions-matrix.outputs.matrix }}
dep-suggests-matrix: ${{ steps.dep-suggests-matrix.outputs.matrix }}
name: "Smoke test: stock R"
# Begin custom: services
# End custom: services
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/workflows/rate-limit
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/workflows/git-identity
- uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''
- uses: ./.github/workflows/install
with:
token: ${{ secrets.GITHUB_TOKEN }}
cache-version: rcc-smoke-2
needs: check, website
# Beware of using dev pkgdown here, has brought in dev dependencies in the past
extra-packages: any::rcmdcheck r-lib/roxygen2 any::decor r-lib/styler pkgdown deps::.
- name: Install package
run: |
R CMD INSTALL .
shell: bash
- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''
- id: versions-matrix
# Only run for pull requests if the base repo is different from the head repo, always run for other events
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
uses: ./.github/workflows/versions-matrix
- id: dep-suggests-matrix
uses: ./.github/workflows/dep-suggests-matrix
- uses: ./.github/workflows/update-snapshots
- uses: ./.github/workflows/style
- uses: ./.github/workflows/roxygenize
- name: Remove config files from previous iteration
run: |
rm -f .github/dep-suggests-matrix.json .github/versions-matrix.json
shell: bash
- id: commit
uses: ./.github/workflows/commit
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/workflows/check
with:
results: ${{ runner.os }}-smoke-test
- uses: ./.github/workflows/pkgdown-build
if: github.event_name != 'push'
- uses: ./.github/workflows/pkgdown-deploy
if: github.event_name == 'push'
# Upload sha as artifact
- run: |
echo -n "${{ steps.commit.outputs.sha }}" > rcc-smoke-sha.txt
shell: bash
- uses: actions/upload-artifact@v4
with:
name: rcc-smoke-sha
path: rcc-smoke-sha.txt
rcc-smoke-check-matrix:
runs-on: ubuntu-latest
name: "Check matrix"
needs:
- rcc-smoke
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.rcc-smoke.outputs.sha }}
- uses: ./.github/workflows/matrix-check
with:
matrix: ${{ needs.rcc-smoke.outputs.versions-matrix }}
- uses: ./.github/workflows/matrix-check
with:
matrix: ${{ needs.rcc-smoke.outputs.dep-suggests-matrix }}
rcc-full:
needs:
- rcc-smoke
runs-on: ${{ matrix.os }}
if: ${{ needs.rcc-smoke.outputs.versions-matrix != '' }}
name: 'rcc: ${{ matrix.os }} (${{ matrix.r }}) ${{ matrix.desc }}'
# Begin custom: services
# End custom: services
strategy:
fail-fast: false
matrix: ${{fromJson(needs.rcc-smoke.outputs.versions-matrix)}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.rcc-smoke.outputs.sha }}
- uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''
- uses: ./.github/workflows/install
with:
r-version: ${{ matrix.r }}
cache-version: rcc-full-1
token: ${{ secrets.GITHUB_TOKEN }}
needs: check
- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''
- uses: ./.github/workflows/update-snapshots
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
- uses: ./.github/workflows/check
with:
results: ${{ runner.os }}-r${{ matrix.r }}
rcc-suggests:
needs:
- rcc-smoke
runs-on: ubuntu-22.04
if: ${{ needs.rcc-smoke.outputs.dep-suggests-matrix != '' }}
name: Without ${{ matrix.package }}
# Begin custom: services
# End custom: services
strategy:
fail-fast: false
matrix: ${{fromJson(needs.rcc-smoke.outputs.dep-suggests-matrix)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''
- uses: ./.github/workflows/install
with:
install-r: false
cache-version: rcc-dev-${{ matrix.package }}-1
needs: check
extra-packages: "any::rcmdcheck any::remotes ."
token: ${{ secrets.GITHUB_TOKEN }}
- name: Remove ${{ matrix.package }} and all strong dependencies
run: |
pkg <- "${{ matrix.package }}"
pkgs <- tools::package_dependencies(pkg, reverse = TRUE)[[1]]
installed <- rownames(utils::installed.packages())
to_remove <- c(pkg, intersect(pkgs, installed))
print(to_remove)
remove.packages(to_remove)
shell: Rscript {0}
- name: Session info
run: |
options(width = 100)
if (!requireNamespace("sessioninfo", quietly = TRUE)) install.packages("sessioninfo")
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''
- name: Define _R_CHECK_FORCE_SUGGESTS_
run: |
cat('_R_CHECK_FORCE_SUGGESTS_=false\n', file = Sys.getenv("GITHUB_ENV"), append = TRUE)
shell: Rscript {0}
- name: Must allow NOTEs, even with _R_CHECK_FORCE_SUGGESTS_
run: |
if (Sys.getenv("RCMDCHECK_ERROR_ON") %in% c("", "note")) {
cat('RCMDCHECK_ERROR_ON="warning"\n', file = Sys.getenv("GITHUB_ENV"), append = TRUE)
}
shell: Rscript {0}
- name: Check env vars
run: |
print(Sys.getenv('_R_CHECK_FORCE_SUGGESTS_'))
print(Sys.getenv('RCMDCHECK_ERROR_ON'))
shell: Rscript {0}
- uses: ./.github/workflows/check
with:
results: ${{ matrix.package }}