Skip to content

Commit c529c12

Browse files
committed
Update check-bioc.yml
1 parent f15cc01 commit c529c12

File tree

1 file changed

+85
-36
lines changed

1 file changed

+85
-36
lines changed

.github/workflows/check-bioc.yml

Lines changed: 85 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ env:
3838
run_covr: 'true'
3939
run_pkgdown: 'false'
4040
has_RUnit: 'false'
41-
cache-version: 'cache-v5'
42-
41+
cache-version: 'cache-v1'
42+
run_docker: 'false'
4343

4444
jobs:
4545
build-check:
@@ -52,9 +52,11 @@ jobs:
5252
fail-fast: false
5353
matrix:
5454
config:
55-
- { os: ubuntu-latest, r: 'devel', bioc: '3.15', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
56-
- { os: macOS-latest, r: 'devel', bioc: 'devel'}
57-
- { os: windows-latest, r: 'devel', bioc: 'devel'}
55+
- { os: ubuntu-latest, r: '4.2', bioc: '3.16', cont: "bioconductor/bioconductor_docker:RELEASE_3_16", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
56+
- { os: macOS-latest, r: '4.2', bioc: '3.16'}
57+
- { os: windows-latest, r: '4.2', bioc: '3.16'}
58+
## Check https://github.com/r-lib/actions/tree/master/examples
59+
## for examples using the http-user-agent
5860
env:
5961
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
6062
RSPM: ${{ matrix.config.rspm }}
@@ -77,41 +79,42 @@ jobs:
7779
## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
7880
## If they update their steps, we will also need to update ours.
7981
- name: Checkout Repository
80-
uses: actions/checkout@v2
82+
uses: actions/checkout@v3
8183

8284
## R is already included in the Bioconductor docker images
8385
- name: Setup R from r-lib
8486
if: runner.os != 'Linux'
85-
uses: r-lib/actions/setup-r@master
87+
uses: r-lib/actions/setup-r@v2
8688
with:
8789
r-version: ${{ matrix.config.r }}
90+
http-user-agent: ${{ matrix.config.http-user-agent }}
8891

8992
## pandoc is already included in the Bioconductor docker images
9093
- name: Setup pandoc from r-lib
9194
if: runner.os != 'Linux'
92-
uses: r-lib/actions/setup-pandoc@master
95+
uses: r-lib/actions/setup-pandoc@v2
9396

9497
- name: Query dependencies
9598
run: |
9699
install.packages('remotes')
97100
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
98101
shell: Rscript {0}
99102

100-
- name: Cache R packages
103+
- name: Restore R package cache
101104
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os != 'Linux'"
102-
uses: actions/cache@v2
105+
uses: actions/cache@v3
103106
with:
104107
path: ${{ env.R_LIBS_USER }}
105-
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel-${{ hashFiles('.github/depends.Rds') }}
106-
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel-
108+
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_16-r-4.2-${{ hashFiles('.github/depends.Rds') }}
109+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_16-r-4.2-
107110

108111
- name: Cache R packages on Linux
109112
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os == 'Linux' "
110-
uses: actions/cache@v2
113+
uses: actions/cache@v3
111114
with:
112115
path: /home/runner/work/_temp/Library
113-
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel-${{ hashFiles('.github/depends.Rds') }}
114-
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel-
116+
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_16-r-4.2-${{ hashFiles('.github/depends.Rds') }}
117+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_16-r-4.2-
115118

116119
- name: Install Linux system dependencies
117120
if: runner.os == 'Linux'
@@ -137,6 +140,9 @@ jobs:
137140
## For installing usethis's dependency gert
138141
brew install libgit2
139142
143+
## Required for tcltk
144+
brew install xquartz --cask
145+
140146
- name: Install Windows system dependencies
141147
if: runner.os == 'Windows'
142148
run: |
@@ -151,7 +157,7 @@ jobs:
151157

152158
- name: Set BiocVersion
153159
run: |
154-
BiocManager::install(version = "${{ matrix.config.bioc }}", ask = FALSE)
160+
BiocManager::install(version = "${{ matrix.config.bioc }}", ask = FALSE, force = TRUE)
155161
shell: Rscript {0}
156162

157163
- name: Install dependencies pass 1
@@ -163,22 +169,37 @@ jobs:
163169
## https://github.com/r-lib/remotes/issues/296
164170
## Ideally, all dependencies should get installed in the first pass.
165171
172+
## Set the repos source depending on the OS
173+
## Alternatively use https://storage.googleapis.com/bioconductor_docker/packages/
174+
## though based on https://bit.ly/bioc2021-package-binaries
175+
## the Azure link will be the main one going forward.
176+
gha_repos <- if(
177+
.Platform$OS.type == "unix" && Sys.info()["sysname"] != "Darwin"
178+
) c(
179+
"AnVIL" = "https://bioconductordocker.blob.core.windows.net/packages/3.16/bioc",
180+
BiocManager::repositories()
181+
) else BiocManager::repositories()
182+
183+
## For running the checks
184+
message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****'))
185+
install.packages(c("rcmdcheck", "BiocCheck"), repos = gha_repos)
186+
166187
## Pass #1 at installing dependencies
188+
## This pass uses AnVIL-powered fast binaries
189+
## details at https://github.com/nturaga/bioc2021-bioconductor-binaries
190+
## The speed gains only apply to the docker builds.
167191
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****'))
168-
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE)
192+
remotes::install_local(dependencies = TRUE, repos = gha_repos, build_vignettes = FALSE, upgrade = TRUE)
169193
continue-on-error: true
170194
shell: Rscript {0}
171195

172196
- name: Install dependencies pass 2
173197
run: |
174198
## Pass #2 at installing dependencies
199+
## This pass does not use AnVIL and will thus update any packages
200+
## that have seen been updated in Bioconductor
175201
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****'))
176-
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE)
177-
178-
## For running the checks
179-
message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****'))
180-
remotes::install_cran("rcmdcheck")
181-
BiocManager::install("BiocCheck")
202+
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE, force = TRUE)
182203
shell: Rscript {0}
183204

184205
- name: Install BiocGenerics
@@ -197,7 +218,7 @@ jobs:
197218
- name: Install pkgdown
198219
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
199220
run: |
200-
remotes::install_github("r-lib/pkgdown")
221+
remotes::install_cran("pkgdown")
201222
shell: Rscript {0}
202223

203224
- name: Session info
@@ -210,10 +231,12 @@ jobs:
210231
- name: Run CMD check
211232
env:
212233
_R_CHECK_CRAN_INCOMING_: false
234+
DISPLAY: 99.0
213235
run: |
236+
options(crayon.enabled = TRUE)
214237
rcmdcheck::rcmdcheck(
215-
args = c("--no-build-vignettes", "--no-manual", "--timings"),
216-
build_args = c("--no-manual", "--no-resave-data"),
238+
args = c("--no-manual", "--no-vignettes", "--timings"),
239+
build_args = c("--no-manual", "--keep-empty-dirs", "--no-resave-data"),
217240
error_on = "warning",
218241
check_dir = "check"
219242
)
@@ -231,14 +254,14 @@ jobs:
231254
shell: Rscript {0}
232255

233256
- name: Run BiocCheck
257+
env:
258+
DISPLAY: 99.0
234259
run: |
235260
BiocCheck::BiocCheck(
236261
dir('check', 'tar.gz$', full.names = TRUE),
237262
`quit-with-status` = TRUE,
238263
`no-check-R-ver` = TRUE,
239-
`no-check-bioc-help` = TRUE,
240-
`no-check-pkg-size` = TRUE,
241-
`no-check-file-size` = TRUE
264+
`no-check-bioc-help` = TRUE
242265
)
243266
shell: Rscript {0}
244267

@@ -252,21 +275,47 @@ jobs:
252275
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
253276
run: R CMD INSTALL .
254277

255-
- name: Deploy package
278+
- name: Build pkgdown site
256279
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
257-
run: |
258-
git config --local user.email "[email protected]"
259-
git config --local user.name "GitHub Actions"
260-
Rscript -e "pkgdown::deploy_to_branch(new_process = FALSE)"
261-
shell: bash {0}
280+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
281+
shell: Rscript {0}
262282
## Note that you need to run pkgdown::deploy_to_branch(new_process = FALSE)
263283
## at least one locally before this will work. This creates the gh-pages
264284
## branch (erasing anything you haven't version controlled!) and
265285
## makes the git history recognizable by pkgdown.
266286

287+
- name: Install deploy dependencies
288+
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
289+
run: |
290+
apt-get update && apt-get -y install rsync
291+
292+
- name: Deploy pkgdown site to GitHub pages 🚀
293+
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
294+
uses: JamesIves/github-pages-deploy-action@releases/v4
295+
with:
296+
clean: false
297+
branch: gh-pages
298+
folder: docs
299+
267300
- name: Upload check results
268301
if: failure()
269302
uses: actions/upload-artifact@master
270303
with:
271-
name: ${{ runner.os }}-biocversion-devel-r-devel-results
304+
name: ${{ runner.os }}-biocversion-RELEASE_3_16-r-4.2-results
272305
path: check
306+
307+
## Note that DOCKER_PASSWORD is really a token for your dockerhub
308+
## account, not your actual dockerhub account password.
309+
## This comes from
310+
## https://seandavi.github.io/BuildABiocWorkshop/articles/HOWTO_BUILD_WORKSHOP.html#6-add-secrets-to-github-repo
311+
## Check https://github.com/docker/build-push-action/tree/releases/v1
312+
## for more details.
313+
- uses: docker/build-push-action@v1
314+
if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && runner.os == 'Linux' "
315+
with:
316+
username: ${{ secrets.DOCKER_USERNAME }}
317+
password: ${{ secrets.DOCKER_PASSWORD }}
318+
repository: computational-metabolomics/structtoolbox
319+
tag_with_ref: true
320+
tag_with_sha: true
321+
tags: latest

0 commit comments

Comments
 (0)