Skip to content

Commit e3e3329

Browse files
committed
update to match r-lib/actions@9b2160f, update the template yml, use the workaround at actions/checkout#238 (comment) for to get a git >= 2.18
1 parent 2d5dac6 commit e3e3329

File tree

2 files changed

+81
-70
lines changed

2 files changed

+81
-70
lines changed

.github/workflows/check-bioc.yml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ jobs:
108108
- /home/runner/work/_temp/Library:/usr/local/lib/R/host-site-library
109109

110110
steps:
111+
112+
- name: Install Git
113+
run: |
114+
sudo add-apt-repository ppa:git-core/ppa -y
115+
sudo apt-get update
116+
sudo apt-get install git -y
117+
shell: bash {0}
118+
## Related to https://github.com/actions/checkout/issues/238
119+
111120
## Most of these steps are the same as the ones in
112121
## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
113122
## If they update their steps, we will also need to update ours.
@@ -167,8 +176,7 @@ jobs:
167176
- name: Install dependencies
168177
run: |
169178
## Try installing the package dependencies in steps. First the local
170-
## dependencies, then the local dependencies again in case that was
171-
## needed, and finally any remaining dependencies to avoid the
179+
## dependencies, then any remaining dependencies to avoid the
172180
## issues described at
173181
## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html
174182
## https://github.com/r-lib/remotes/issues/296
@@ -181,12 +189,7 @@ jobs:
181189
BiocManager::install(local_deps[local_deps %in% deps$package[deps$diff != 0]])
182190
183191
## Pass #2 at installing dependencies
184-
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: local dependencies again ****'))
185-
deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories())
186-
BiocManager::install(local_deps[local_deps %in% deps$package[deps$diff != 0]])
187-
188-
## Pass #3 at installing dependencies
189-
message(paste('****', Sys.time(), 'pass number 3 at installing dependencies: any remaining dependencies ****'))
192+
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****'))
190193
deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories())
191194
BiocManager::install(deps$package[deps$diff != 0])
192195
@@ -206,9 +209,16 @@ jobs:
206209
}
207210
shell: Rscript {0}
208211

212+
- name: Session info
213+
run: |
214+
options(width = 120)
215+
pkgs <- installed.packages()[, "Package"]
216+
sessioninfo::session_info(pkgs, include_base = TRUE)
217+
shell: Rscript {0}
218+
209219
- name: Check
210220
env:
211-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
221+
_R_CHECK_CRAN_INCOMING_: false
212222
run: |
213223
rcmdcheck::rcmdcheck(
214224
args = c("--no-build-vignettes", "--no-manual", "--timings"),
@@ -294,12 +304,13 @@ jobs:
294304
## Comment/Un-comment in case you also want to run other versions
295305
- {os: windows-latest}
296306
- {os: macOS-latest}
297-
# - {os: ubuntu-16.04, rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
307+
# - {os: ubuntu-16.04, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
298308

299309
env:
300310
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
301311
RSPM: ${{ matrix.config.rspm }}
302312
BIOCVERSIONNUM: ${{ needs.R-CMD-check-bioc.outputs.biocversionnum }}
313+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
303314

304315
steps:
305316
- uses: actions/checkout@v2
@@ -356,6 +367,7 @@ jobs:
356367

357368
- name: Install BiocManager
358369
run: |
370+
message(paste('****', Sys.time(), 'installing BiocManager ****'))
359371
remotes::install_cran("BiocManager")
360372
shell: Rscript {0}
361373

@@ -367,14 +379,11 @@ jobs:
367379
- name: Install dependencies
368380
run: |
369381
## Try installing the package dependencies in steps. First the local
370-
## dependencies, then the local dependencies again in case that was
371-
## needed, and finally any remaining dependencies to avoid the
382+
## dependencies, then any remaining dependencies to avoid the
372383
## issues described at
373384
## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html
374385
## https://github.com/r-lib/remotes/issues/296
375386
## Ideally, all dependencies should get installed in the first pass.
376-
message(paste('****', Sys.time(), 'installing BiocManager ****'))
377-
remotes::install_cran("BiocManager")
378387
379388
## Pass #1 at installing dependencies
380389
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****'))
@@ -383,12 +392,7 @@ jobs:
383392
BiocManager::install(local_deps[local_deps %in% deps$package[deps$diff != 0]])
384393
385394
## Pass #2 at installing dependencies
386-
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: local dependencies again ****'))
387-
deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories())
388-
BiocManager::install(local_deps[local_deps %in% deps$package[deps$diff != 0]])
389-
390-
## Pass #3 at installing dependencies
391-
message(paste('****', Sys.time(), 'pass number 3 at installing dependencies: any remaining dependencies ****'))
395+
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****'))
392396
deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories())
393397
BiocManager::install(deps$package[deps$diff != 0])
394398
@@ -400,7 +404,7 @@ jobs:
400404

401405
- name: Check
402406
env:
403-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
407+
_R_CHECK_CRAN_INCOMING_: false
404408
run: |
405409
rcmdcheck::rcmdcheck(
406410
args = c("--no-build-vignettes", "--no-manual", "--timings"),

actions/check-bioc.yml

Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,14 @@ jobs:
108108
- /home/runner/work/_temp/Library:/usr/local/lib/R/host-site-library
109109

110110
steps:
111-
## Most of these steps are the same as the ones in
111+
- name: Install Git
112+
run: |
113+
sudo add-apt-repository ppa:git-core/ppa -y
114+
sudo apt-get update
115+
sudo apt-get install git -y
116+
shell: bash {0}
117+
118+
## Related to https://github.com/actions/checkout/issues/238## Most of these steps are the same as the ones in
112119
## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
113120
## If they update their steps, we will also need to update ours.
114121
- uses: actions/checkout@v2
@@ -117,24 +124,52 @@ jobs:
117124
run: |
118125
install.packages('remotes')
119126
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
127+
message(paste('****', Sys.time(), 'installing BiocManager ****'))
128+
remotes::install_cran("BiocManager")
120129
shell: Rscript {0}
121130

131+
## Find the corresponding R version based on the Bioconductor version
132+
## to use for the macOS and Windows checks by the next GHA job
133+
- id: findrversion
134+
run: |
135+
## Find what branch we are working on
136+
if echo "$GITHUB_REF" | grep -q "master"; then
137+
biocversion="devel"
138+
elif echo "$GITHUB_REF" | grep -q "RELEASE_"; then
139+
biocversion="release"
140+
fi
141+
142+
## Define the R and Bioconductor version numbers
143+
biocversionnum=$(Rscript -e "info <- BiocManager:::.version_map_get_online('https://bioconductor.org/config.yaml'); res <- subset(info, BiocStatus == '${biocversion}')[, 'Bioc']; cat(as.character(res))")
144+
rversion=$(Rscript -e "info <- BiocManager:::.version_map_get_online('https://bioconductor.org/config.yaml'); res <- subset(info, BiocStatus == '${biocversion}')[, 'R']; cat(as.character(res))")
145+
146+
## Print the results
147+
echo $biocversion
148+
echo $biocversionnum
149+
echo $rversion
150+
151+
## Save the info for the next job
152+
echo "::set-output name=rversion::${rversion}"
153+
echo "::set-output name=biocversionnum::${biocversionnum}"
154+
shell:
155+
bash {0}
156+
122157
- name: Cache R packages
123158
if: "!contains(github.event.head_commit.message, '/nocache')"
124159
uses: actions/cache@v1
125160
with:
126161
path: /home/runner/work/_temp/Library
127-
key: ${{ env.cache-version }}-${{ runner.os }}-r-biocdocker-bioc-${{ needs.define-docker-info.outputs.biocversion }}-${{ hashFiles('.github/depends.Rds') }}
128-
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r-biocdocker-bioc-${{ needs.define-docker-info.outputs.biocversion }}-
129-
130-
- name: Install system dependencies
131-
if: runner.os == 'Linux'
132-
env:
133-
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
134-
run: |
135-
Rscript -e "remotes::install_github('r-hub/sysreqs')"
136-
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
137-
sudo -s eval "$sysreqs"
162+
key: ${{ env.cache-version }}-${{ runner.os }}-biocdocker-biocbranch-${{ needs.define-docker-info.outputs.biocversion }}-r-${{ steps.findrversion.outputs.rversion }}-bioc-${{ steps.findrversion.outputs.biocversionnum }}-${{ hashFiles('.github/depends.Rds') }}
163+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocdocker-biocbranch-${{ needs.define-docker-info.outputs.biocversion }}-r-${{ steps.findrversion.outputs.rversion }}-bioc-${{ steps.findrversion.outputs.biocversionnum }}-
164+
165+
# - name: Install system dependencies
166+
# if: runner.os == 'Linux'
167+
# env:
168+
# RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
169+
# run: |
170+
# Rscript -e "remotes::install_github('r-hub/sysreqs')"
171+
# sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
172+
# sudo -s eval "$sysreqs"
138173

139174
- name: Install dependencies
140175
run: |
@@ -144,8 +179,6 @@ jobs:
144179
## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html
145180
## https://github.com/r-lib/remotes/issues/296
146181
## Ideally, all dependencies should get installed in the first pass.
147-
message(paste('****', Sys.time(), 'installing BiocManager ****'))
148-
remotes::install_cran("BiocManager")
149182
150183
## Pass #1 at installing dependencies
151184
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****'))
@@ -176,7 +209,7 @@ jobs:
176209

177210
- name: Check
178211
env:
179-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
212+
_R_CHECK_CRAN_INCOMING_: false
180213
run: |
181214
rcmdcheck::rcmdcheck(
182215
args = c("--no-build-vignettes", "--no-manual", "--timings"),
@@ -236,37 +269,11 @@ jobs:
236269
## branch (erasing anything you haven't version controlled!) and
237270
## makes the git history recognizable by pkgdown.
238271

239-
## Find the corresponding R version based on the Bioconductor version
240-
## to use for the macOS and Windows checks by the next GHA job
241-
- id: findrversion
242-
run: |
243-
## Find what branch we are working on
244-
if echo "$GITHUB_REF" | grep -q "master"; then
245-
biocversion="devel"
246-
elif echo "$GITHUB_REF" | grep -q "RELEASE_"; then
247-
biocversion="release"
248-
fi
249-
250-
## Define the R and Bioconductor version numbers
251-
biocversionnum=$(Rscript -e "info <- BiocManager:::.version_map_get_online('https://bioconductor.org/config.yaml'); res <- subset(info, BiocStatus == '${biocversion}')[, 'Bioc']; cat(as.character(res))")
252-
rversion=$(Rscript -e "info <- BiocManager:::.version_map_get_online('https://bioconductor.org/config.yaml'); res <- subset(info, BiocStatus == '${biocversion}')[, 'R']; cat(as.character(res))")
253-
254-
## Print the results
255-
echo $biocversion
256-
echo $biocversionnum
257-
echo $rversion
258-
259-
## Save the info for the next job
260-
echo "::set-output name=rversion::${rversion}"
261-
echo "::set-output name=biocversionnum::${biocversionnum}"
262-
shell:
263-
bash {0}
264-
265272
- name: Upload check results
266273
if: failure()
267274
uses: actions/upload-artifact@master
268275
with:
269-
name: ${{ runner.os }}-r-biocdocker-bioc-${{ needs.define-docker-info.outputs.biocversion }}-results
276+
name: ${{ runner.os }}-biocdocker-biocbranch-${{ needs.define-docker-info.outputs.biocversion }}-r-${{ steps.findrversion.outputs.rversion }}-bioc-${{ steps.findrversion.outputs.biocversionnum }}-results
270277
path: check
271278

272279
## Run R CMD check on both macOS and Windows. You can also run the
@@ -288,12 +295,13 @@ jobs:
288295
## Comment/Un-comment in case you also want to run other versions
289296
- {os: windows-latest}
290297
- {os: macOS-latest}
291-
# - {os: ubuntu-16.04, rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
298+
# - {os: ubuntu-16.04, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
292299

293300
env:
294301
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
295302
RSPM: ${{ matrix.config.rspm }}
296303
BIOCVERSIONNUM: ${{ needs.R-CMD-check-bioc.outputs.biocversionnum }}
304+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
297305

298306
steps:
299307
- uses: actions/checkout@v2
@@ -317,8 +325,8 @@ jobs:
317325
uses: actions/cache@v1
318326
with:
319327
path: ${{ env.R_LIBS_USER }}
320-
key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ needs.R-CMD-check-bioc.outputs.rversion }}-bioc-${{ needs.define-docker-info.outputs.biocversion }}-${{ hashFiles('.github/depends.Rds') }}
321-
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r-${{ needs.R-CMD-check-bioc.outputs.rversion }}-bioc-${{ needs.define-docker-info.outputs.biocversion }}-
328+
key: ${{ env.cache-version }}-${{ runner.os }}-biocbranch-${{ needs.define-docker-info.outputs.biocversion }}-r-${{ needs.R-CMD-check-bioc.outputs.rversion }}-bioc-${{ needs.define-docker-info.outputs.biocversion }}-${{ hashFiles('.github/depends.Rds') }}
329+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocbranch-${{ needs.define-docker-info.outputs.biocversion }}-r-${{ needs.R-CMD-check-bioc.outputs.rversion }}-bioc-${{ needs.define-docker-info.outputs.biocversion }}-
322330

323331
- name: Install Linux system dependencies
324332
if: runner.os == 'Linux'
@@ -350,6 +358,7 @@ jobs:
350358

351359
- name: Install BiocManager
352360
run: |
361+
message(paste('****', Sys.time(), 'installing BiocManager ****'))
353362
remotes::install_cran("BiocManager")
354363
shell: Rscript {0}
355364

@@ -366,8 +375,6 @@ jobs:
366375
## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html
367376
## https://github.com/r-lib/remotes/issues/296
368377
## Ideally, all dependencies should get installed in the first pass.
369-
message(paste('****', Sys.time(), 'installing BiocManager ****'))
370-
remotes::install_cran("BiocManager")
371378
372379
## Pass #1 at installing dependencies
373380
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****'))
@@ -388,7 +395,7 @@ jobs:
388395

389396
- name: Check
390397
env:
391-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
398+
_R_CHECK_CRAN_INCOMING_: false
392399
run: |
393400
rcmdcheck::rcmdcheck(
394401
args = c("--no-build-vignettes", "--no-manual", "--timings"),
@@ -418,5 +425,5 @@ jobs:
418425
if: failure()
419426
uses: actions/upload-artifact@master
420427
with:
421-
name: ${{ runner.os }}-r-${{ needs.R-CMD-check-bioc.outputs.rversion }}-bioc-${{ needs.define-docker-info.outputs.biocversion }}-results
428+
name: ${{ runner.os }}-biocbranch-${{ needs.define-docker-info.outputs.biocversion }}-r-${{ needs.R-CMD-check-bioc.outputs.rversion }}-bioc-${{ needs.define-docker-info.outputs.biocversion }}-results
422429
path: check

0 commit comments

Comments
 (0)