5
5
# # https://lcolladotor.github.io/biocthis/articles/biocthis_dev_notes.html
6
6
# #
7
7
# # You can add this workflow to other packages using:
8
- # # > biocthis::use_bioc_github_action()
8
+ # # > biocthis::use_bioc_github_action("devel", testthat = TRUE, pkgdown = TRUE )
9
9
# #
10
10
# # Using GitHub Actions exposes you to many details about how R packages are
11
11
# # compiled and installed in several operating system.s
@@ -52,10 +52,10 @@ jobs:
52
52
fail-fast : false
53
53
matrix :
54
54
config :
55
- - { os: ubuntu-latest, r: '4.2 ', bioc: '3.16 ', cont: "bioconductor/bioconductor_docker:devel", 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/v2 /examples
55
+ - { os: ubuntu-latest, r: 'devel ', bioc: '3.19 ', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy /latest" }
56
+ - { os: macOS-latest, r: 'devel ', bioc: '3.19 '}
57
+ - { os: windows-latest, r: 'devel ', bioc: '3.19 '}
58
+ # # Check https://github.com/r-lib/actions/tree/master /examples
59
59
# # for examples using the http-user-agent
60
60
env :
61
61
R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
@@ -76,10 +76,10 @@ jobs:
76
76
echo ".libPaths('/__w/_temp/Library')" > ~/.Rprofile
77
77
78
78
# # Most of these steps are the same as the ones in
79
- # # https://github.com/r-lib/actions/blob/v2 /examples/check-standard.yaml
79
+ # # https://github.com/r-lib/actions/blob/master /examples/check-standard.yaml
80
80
# # If they update their steps, we will also need to update ours.
81
81
- name : Checkout Repository
82
- uses : actions/checkout@v2
82
+ uses : actions/checkout@v3
83
83
84
84
# # R is already included in the Bioconductor docker images
85
85
- name : Setup R from r-lib
@@ -102,26 +102,26 @@ jobs:
102
102
103
103
- name : Restore R package cache
104
104
if : " !contains(github.event.head_commit.message, '/nocache') && runner.os != 'Linux'"
105
- uses : actions/cache@v2
105
+ uses : actions/cache@v3
106
106
with :
107
107
path : ${{ env.R_LIBS_USER }}
108
- key : ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-4.2 -${{ hashFiles('.github/depends.Rds') }}
109
- restore-keys : ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-4.2 -
108
+ key : ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel -${{ hashFiles('.github/depends.Rds') }}
109
+ restore-keys : ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel -
110
110
111
111
- name : Cache R packages on Linux
112
112
if : " !contains(github.event.head_commit.message, '/nocache') && runner.os == 'Linux' "
113
- uses : actions/cache@v2
113
+ uses : actions/cache@v3
114
114
with :
115
115
path : /home/runner/work/_temp/Library
116
- key : ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-4.2 -${{ hashFiles('.github/depends.Rds') }}
117
- restore-keys : ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-4.2 -
116
+ key : ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel -${{ hashFiles('.github/depends.Rds') }}
117
+ restore-keys : ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel -
118
118
119
- - name : Install Linux system dependencies
120
- if : runner.os == 'Linux'
121
- run : |
122
- sysreqs=$(Rscript -e 'cat("apt-get update -y && apt-get install -y", paste(gsub("apt-get install -y ", "", remotes::system_requirements("ubuntu", "20.04")), collapse = " "))')
123
- echo $sysreqs
124
- sudo -s eval "$sysreqs"
119
+ # - name: Install Linux system dependencies
120
+ # if: runner.os == 'Linux'
121
+ # run: |
122
+ # sysreqs=$(Rscript -e 'cat("apt-get update -y && apt-get install -y", paste(gsub("apt-get install -y ", "", remotes::system_requirements("ubuntu", "20.04")), collapse = " "))')
123
+ # echo $sysreqs
124
+ # sudo -s eval "$sysreqs"
125
125
126
126
- name : Install macOS system dependencies
127
127
if : matrix.config.os == 'macOS-latest'
@@ -169,35 +169,19 @@ jobs:
169
169
## https://github.com/r-lib/remotes/issues/296
170
170
## Ideally, all dependencies should get installed in the first pass.
171
171
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
172
## For running the checks
184
173
message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****'))
185
- install.packages(c("rcmdcheck", "BiocCheck"), repos = gha_repos )
174
+ install.packages(c("rcmdcheck", "BiocCheck"), repos = BiocManager::repositories() )
186
175
187
176
## 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.
191
177
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****'))
192
- remotes::install_local(dependencies = TRUE, repos = gha_repos , build_vignettes = FALSE, upgrade = TRUE)
178
+ remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories() , build_vignettes = FALSE, upgrade = TRUE)
193
179
continue-on-error : true
194
180
shell : Rscript {0}
195
181
196
182
- name : Install dependencies pass 2
197
183
run : |
198
184
## 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
201
185
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****'))
202
186
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE, force = TRUE)
203
187
shell : Rscript {0}
@@ -210,15 +194,15 @@ jobs:
210
194
shell : Rscript {0}
211
195
212
196
- name : Install covr
213
- if : github.ref == 'refs/heads/master ' && env.run_covr == 'true' && runner.os == 'Linux'
197
+ if : github.ref == 'refs/heads/devel ' && env.run_covr == 'true' && runner.os == 'Linux'
214
198
run : |
215
199
remotes::install_cran("covr")
216
200
shell : Rscript {0}
217
201
218
202
- name : Install pkgdown
219
- if : github.ref == 'refs/heads/master ' && env.run_pkgdown == 'true' && runner.os == 'Linux'
203
+ if : github.ref == 'refs/heads/devel ' && env.run_pkgdown == 'true' && runner.os == 'Linux'
220
204
run : |
221
- remotes::install_cran(" pkgdown")
205
+ remotes::install_github("r-lib/ pkgdown")
222
206
shell : Rscript {0}
223
207
224
208
- name : Session info
@@ -266,46 +250,89 @@ jobs:
266
250
shell : Rscript {0}
267
251
268
252
- name : Test coverage
269
- if : github.ref == 'refs/heads/master ' && env.run_covr == 'true' && runner.os == 'Linux'
253
+ if : github.ref == 'refs/heads/devel ' && env.run_covr == 'true' && runner.os == 'Linux'
270
254
run : |
271
- covr::codecov()
255
+ covr::codecov(coverage = covr::package_coverage(type = "all") )
272
256
shell : Rscript {0}
273
257
274
258
- name : Install package
275
- if : github.ref == 'refs/heads/master ' && env.run_pkgdown == 'true' && runner.os == 'Linux'
259
+ if : github.ref == 'refs/heads/devel ' && env.run_pkgdown == 'true' && runner.os == 'Linux'
276
260
run : R CMD INSTALL .
277
261
278
- - name : Build and deploy pkgdown site
279
- if : github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
280
- run : |
281
- git config --local user.name "$GITHUB_ACTOR"
282
- git config --local user.email "[email protected] "
283
- Rscript -e "pkgdown::deploy_to_branch(new_process = FALSE)"
284
- shell : bash {0}
262
+ - name : Build pkgdown site
263
+ if : github.ref == 'refs/heads/devel' && env.run_pkgdown == 'true' && runner.os == 'Linux'
264
+ run : pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
265
+ shell : Rscript {0}
285
266
# # Note that you need to run pkgdown::deploy_to_branch(new_process = FALSE)
286
267
# # at least one locally before this will work. This creates the gh-pages
287
268
# # branch (erasing anything you haven't version controlled!) and
288
269
# # makes the git history recognizable by pkgdown.
289
270
271
+ - name : Install deploy dependencies
272
+ if : github.ref == 'refs/heads/devel' && env.run_pkgdown == 'true' && runner.os == 'Linux'
273
+ run : |
274
+ apt-get update && apt-get -y install rsync
275
+
276
+ - name : Deploy pkgdown site to GitHub pages 🚀
277
+ if : github.ref == 'refs/heads/devel' && env.run_pkgdown == 'true' && runner.os == 'Linux'
278
+ uses : JamesIves/github-pages-deploy-action@releases/v4
279
+ with :
280
+ clean : false
281
+ branch : gh-pages
282
+ folder : docs
283
+
290
284
- name : Upload check results
291
285
if : failure()
292
286
uses : actions/upload-artifact@master
293
287
with :
294
- name : ${{ runner.os }}-biocversion-devel-r-4.2 -results
288
+ name : ${{ runner.os }}-biocversion-devel-r-devel -results
295
289
path : check
296
290
297
- # # Note that DOCKER_PASSWORD is really a token for your dockerhub
298
- # # account, not your actual dockerhub account password.
299
- # # This comes from
300
- # # https://seandavi.github.io/BuildABiocWorkshop/articles/HOWTO_BUILD_WORKSHOP.html#6-add-secrets-to-github-repo
301
- # # Check https://github.com/docker/build-push-action/tree/releases/v1
302
- # # for more details.
303
- - uses : docker/build-push-action@v1
304
- if : " !contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && runner.os == 'Linux' "
291
+
292
+ # # Code adapted from
293
+ # # https://github.com/waldronlab/cBioPortalData/blob/e0440a4445f0cc731e426363a76faa22ee5e0f9d/.github/workflows/devel_check_dock.yml#L65-L92
294
+ docker-build-and-push :
295
+ runs-on : ubuntu-latest
296
+ needs : build-check
297
+ steps :
298
+ - name : Checkout Repository
299
+ if : " !contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
300
+ uses : actions/checkout@v3
301
+
302
+ - name : Register repo name
303
+ if : " !contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
304
+ id : reg_repo_name
305
+ run : |
306
+ echo CONT_IMG_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
307
+
308
+ - name : Set up QEMU
309
+ if : " !contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
310
+ uses : docker/setup-qemu-action@v2
311
+
312
+ - name : Set up Docker Buildx
313
+ if : " !contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
314
+ uses : docker/setup-buildx-action@v2
315
+
316
+ - name : Login to Docker Hub
317
+ if : " !contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
318
+ uses : docker/login-action@v2
319
+ with :
320
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
321
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
322
+ # # Note that DOCKERHUB_TOKEN is really a token for your dockerhub
323
+ # # account, not your actual dockerhub account password. You can get it
324
+ # # from https://hub.docker.com/settings/security.
325
+ # # Check https://github.com/docker/build-push-action/tree/v4.0.0
326
+ # # for more details.
327
+ # # Alternatively, try checking
328
+ # # https://seandavi.github.io/BuildABiocWorkshop/articles/HOWTO_BUILD_WORKSHOP.html.
329
+
330
+ - name : Build and Push Docker
331
+ if : " !contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel' && success()"
332
+ uses : docker/build-push-action@v4
305
333
with :
306
- username : ${{ secrets.DOCKER_USERNAME }}
307
- password : ${{ secrets.DOCKER_PASSWORD }}
308
- repository : sgibb/cleaver
309
- tag_with_ref : true
310
- tag_with_sha : true
311
- tags : latest
334
+ context : .
335
+ push : true
336
+ tags : >
337
+ ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.CONT_IMG_NAME }}:latest,
338
+ ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.CONT_IMG_NAME }}:devel
0 commit comments