Skip to content

Commit 251b346

Browse files
update GH
1 parent c5283ac commit 251b346

File tree

1 file changed

+72
-56
lines changed

1 file changed

+72
-56
lines changed

.github/workflows/check-bioc.yml

+72-56
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ jobs:
5252
fail-fast: false
5353
matrix:
5454
config:
55-
- { os: ubuntu-latest, r: 'devel', bioc: '3.18', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
56-
- { os: macOS-latest, r: 'devel', bioc: '3.18'}
57-
- { os: windows-latest, r: 'devel', bioc: '3.18'}
55+
- { os: ubuntu-latest, r: '4.4', bioc: '3.20', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest" }
56+
- { os: macOS-latest, r: '4.4', bioc: '3.20'}
57+
- { os: windows-latest, r: '4.4', bioc: '3.20'}
5858
## Check https://github.com/r-lib/actions/tree/master/examples
5959
## for examples using the http-user-agent
6060
env:
@@ -105,23 +105,23 @@ jobs:
105105
uses: actions/cache@v3
106106
with:
107107
path: ${{ env.R_LIBS_USER }}
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-
108+
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-4.4-${{ hashFiles('.github/depends.Rds') }}
109+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-4.4-
110110

111111
- name: Cache R packages on Linux
112112
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os == 'Linux' "
113113
uses: actions/cache@v3
114114
with:
115115
path: /home/runner/work/_temp/Library
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-
116+
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-4.4-${{ hashFiles('.github/depends.Rds') }}
117+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-4.4-
118118

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"
125125

126126
- name: Install macOS system dependencies
127127
if: matrix.config.os == 'macOS-latest'
@@ -169,35 +169,19 @@ jobs:
169169
## https://github.com/r-lib/remotes/issues/296
170170
## Ideally, all dependencies should get installed in the first pass.
171171
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.17/bioc",
180-
BiocManager::repositories()
181-
) else BiocManager::repositories()
182-
183172
## For running the checks
184173
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())
186175
187176
## 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.
191177
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)
193179
continue-on-error: true
194180
shell: Rscript {0}
195181

196182
- name: Install dependencies pass 2
197183
run: |
198184
## 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
201185
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****'))
202186
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE, force = TRUE)
203187
shell: Rscript {0}
@@ -210,13 +194,13 @@ jobs:
210194
shell: Rscript {0}
211195

212196
- 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'
214198
run: |
215199
remotes::install_cran("covr")
216200
shell: Rscript {0}
217201

218202
- 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'
220204
run: |
221205
remotes::install_github("r-lib/pkgdown")
222206
shell: Rscript {0}
@@ -261,23 +245,22 @@ jobs:
261245
dir('check', 'tar.gz$', full.names = TRUE),
262246
`quit-with-status` = TRUE,
263247
`no-check-R-ver` = TRUE,
264-
`no-check-bioc-help` = TRUE,
265-
`no-check-pkg-size` = TRUE
248+
`no-check-bioc-help` = TRUE
266249
)
267250
shell: Rscript {0}
268251

269252
- name: Test coverage
270-
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'
271254
run: |
272-
covr::codecov()
255+
covr::codecov(coverage = covr::package_coverage(type = "all"))
273256
shell: Rscript {0}
274257

275258
- name: Install package
276-
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'
277260
run: R CMD INSTALL .
278261

279262
- name: Build pkgdown site
280-
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
263+
if: github.ref == 'refs/heads/devel' && env.run_pkgdown == 'true' && runner.os == 'Linux'
281264
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
282265
shell: Rscript {0}
283266
## Note that you need to run pkgdown::deploy_to_branch(new_process = FALSE)
@@ -286,12 +269,12 @@ jobs:
286269
## makes the git history recognizable by pkgdown.
287270

288271
- name: Install deploy dependencies
289-
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
272+
if: github.ref == 'refs/heads/devel' && env.run_pkgdown == 'true' && runner.os == 'Linux'
290273
run: |
291274
apt-get update && apt-get -y install rsync
292275
293276
- name: Deploy pkgdown site to GitHub pages 🚀
294-
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
277+
if: github.ref == 'refs/heads/devel' && env.run_pkgdown == 'true' && runner.os == 'Linux'
295278
uses: JamesIves/github-pages-deploy-action@releases/v4
296279
with:
297280
clean: false
@@ -302,21 +285,54 @@ jobs:
302285
if: failure()
303286
uses: actions/upload-artifact@master
304287
with:
305-
name: ${{ runner.os }}-biocversion-devel-r-devel-results
288+
name: ${{ runner.os }}-biocversion-devel-r-4.4-results
306289
path: check
307290

308-
## Note that DOCKER_PASSWORD is really a token for your dockerhub
309-
## account, not your actual dockerhub account password.
310-
## This comes from
311-
## https://seandavi.github.io/BuildABiocWorkshop/articles/HOWTO_BUILD_WORKSHOP.html#6-add-secrets-to-github-repo
312-
## Check https://github.com/docker/build-push-action/tree/releases/v1
313-
## for more details.
314-
- uses: docker/build-push-action@v1
315-
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
316333
with:
317-
username: ${{ secrets.DOCKER_USERNAME }}
318-
password: ${{ secrets.DOCKER_PASSWORD }}
319-
repository: helenalc/muscat
320-
tag_with_ref: true
321-
tag_with_sha: true
322-
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

Comments
 (0)