Skip to content

Commit 03e9587

Browse files
committed
ran biocthis::use_bioc_github_action(pkgdown_covr_branch = "devel")
1 parent c4d9394 commit 03e9587

File tree

1 file changed

+86
-38
lines changed

1 file changed

+86
-38
lines changed

.github/workflows/check-bioc.yml

Lines changed: 86 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ name: R-CMD-check-bioc
3434
## Note that you can always run a GHA test without the cache by using the word
3535
## "/nocache" in the commit message.
3636
env:
37-
has_testthat: 'true'
38-
run_covr: 'true'
39-
run_pkgdown: 'true'
37+
has_testthat: 'false'
38+
run_covr: 'false'
39+
run_pkgdown: 'false'
4040
has_RUnit: 'false'
4141
cache-version: 'cache-v1'
4242
run_docker: 'false'
@@ -52,9 +52,9 @@ jobs:
5252
fail-fast: false
5353
matrix:
5454
config:
55-
- { os: ubuntu-latest, r: '4.1', bioc: '3.14', cont: "bioconductor/bioconductor_docker:RELEASE_3_14", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
56-
- { os: macOS-latest, r: '4.1', bioc: '3.14'}
57-
- { os: windows-latest, r: '4.1', bioc: '3.14'}
55+
- { os: ubuntu-latest, r: '4.2', bioc: '3.16', cont: "bioconductor/bioconductor_docker:RELEASE_3_16", rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest" }
56+
- { os: macOS-latest, r: '4.2', bioc: '3.16'}
57+
- { os: windows-latest, r: '4.2', bioc: '3.16'}
5858
## Check https://github.com/r-lib/actions/tree/master/examples
5959
## for examples using the http-user-agent
6060
env:
@@ -79,20 +79,20 @@ jobs:
7979
## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
8080
## If they update their steps, we will also need to update ours.
8181
- name: Checkout Repository
82-
uses: actions/checkout@v2
82+
uses: actions/checkout@v3
8383

8484
## R is already included in the Bioconductor docker images
8585
- name: Setup R from r-lib
8686
if: runner.os != 'Linux'
87-
uses: r-lib/actions/setup-r@master
87+
uses: r-lib/actions/setup-r@v2
8888
with:
8989
r-version: ${{ matrix.config.r }}
9090
http-user-agent: ${{ matrix.config.http-user-agent }}
9191

9292
## pandoc is already included in the Bioconductor docker images
9393
- name: Setup pandoc from r-lib
9494
if: runner.os != 'Linux'
95-
uses: r-lib/actions/setup-pandoc@master
95+
uses: r-lib/actions/setup-pandoc@v2
9696

9797
- name: Query dependencies
9898
run: |
@@ -102,19 +102,19 @@ jobs:
102102

103103
- name: Restore R package cache
104104
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os != 'Linux'"
105-
uses: actions/cache@v2
105+
uses: actions/cache@v3
106106
with:
107107
path: ${{ env.R_LIBS_USER }}
108-
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_14-r-4.1-${{ hashFiles('.github/depends.Rds') }}
109-
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_3_14-r-4.1-
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-
110110

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

119119
- name: Install Linux system dependencies
120120
if: runner.os == 'Linux'
@@ -176,7 +176,7 @@ jobs:
176176
gha_repos <- if(
177177
.Platform$OS.type == "unix" && Sys.info()["sysname"] != "Darwin"
178178
) c(
179-
"AnVIL" = "https://bioconductordocker.blob.core.windows.net/packages/3.14/bioc",
179+
"AnVIL" = "https://bioconductordocker.blob.core.windows.net/packages/3.16/bioc",
180180
BiocManager::repositories()
181181
) else BiocManager::repositories()
182182
@@ -210,13 +210,13 @@ jobs:
210210
shell: Rscript {0}
211211

212212
- name: Install covr
213-
if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'Linux'
213+
if: github.ref == 'refs/heads/devel' && env.run_covr == 'true' && runner.os == 'Linux'
214214
run: |
215215
remotes::install_cran("covr")
216216
shell: Rscript {0}
217217

218218
- name: Install pkgdown
219-
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
219+
if: github.ref == 'refs/heads/devel' && env.run_pkgdown == 'true' && runner.os == 'Linux'
220220
run: |
221221
remotes::install_cran("pkgdown")
222222
shell: Rscript {0}
@@ -261,46 +261,94 @@ jobs:
261261
dir('check', 'tar.gz$', full.names = TRUE),
262262
`quit-with-status` = TRUE,
263263
`no-check-R-ver` = TRUE,
264-
`no-check-bioc-help` = TRUE,
265-
`no-check-coding-practices` = TRUE
264+
`no-check-bioc-help` = TRUE
266265
)
267266
shell: Rscript {0}
268267

269268
- name: Test coverage
270-
if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'Linux'
269+
if: github.ref == 'refs/heads/devel' && env.run_covr == 'true' && runner.os == 'Linux'
271270
run: |
272271
covr::codecov()
273272
shell: Rscript {0}
274273

275274
- name: Install package
276-
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
275+
if: github.ref == 'refs/heads/devel' && env.run_pkgdown == 'true' && runner.os == 'Linux'
277276
run: R CMD INSTALL .
278277

279-
- name: Build and deploy pkgdown site
280-
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
281-
run: |
282-
git config --local user.name "$GITHUB_ACTOR"
283-
git config --local user.email "[email protected]"
284-
Rscript -e "pkgdown::deploy_to_branch(new_process = FALSE)"
285-
shell: bash {0}
278+
- name: Build pkgdown site
279+
if: github.ref == 'refs/heads/devel' && env.run_pkgdown == 'true' && runner.os == 'Linux'
280+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
281+
shell: Rscript {0}
286282
## Note that you need to run pkgdown::deploy_to_branch(new_process = FALSE)
287283
## at least one locally before this will work. This creates the gh-pages
288284
## branch (erasing anything you haven't version controlled!) and
289285
## makes the git history recognizable by pkgdown.
290286

287+
- name: Install deploy dependencies
288+
if: github.ref == 'refs/heads/devel' && 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/devel' && 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+
291300
- name: Upload check results
292301
if: failure()
293302
uses: actions/upload-artifact@master
294303
with:
295-
name: ${{ runner.os }}-biocversion-RELEASE_3_14-r-4.1-results
304+
name: ${{ runner.os }}-biocversion-RELEASE_3_16-r-4.2-results
296305
path: check
297306

298-
- uses: docker/build-push-action@v1
299-
if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && runner.os == 'Linux' "
307+
308+
## Code adapted from
309+
## https://github.com/waldronlab/cBioPortalData/blob/e0440a4445f0cc731e426363a76faa22ee5e0f9d/.github/workflows/devel_check_dock.yml#L65-L92
310+
docker-build-and-push:
311+
runs-on: ubuntu-latest
312+
needs: build-check
313+
steps:
314+
- name: Checkout Repository
315+
if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
316+
uses: actions/checkout@v3
317+
318+
- name: Register repo name
319+
if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
320+
id: reg_repo_name
321+
run: |
322+
echo CONT_IMG_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
323+
324+
- name: Set up QEMU
325+
if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
326+
uses: docker/setup-qemu-action@v2
327+
328+
- name: Set up Docker Buildx
329+
if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
330+
uses: docker/setup-buildx-action@v2
331+
332+
- name: Login to Docker Hub
333+
if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel'"
334+
uses: docker/login-action@v2
335+
with:
336+
username: ${{ secrets.DOCKERHUB_USERNAME }}
337+
password: ${{ secrets.DOCKERHUB_TOKEN }}
338+
## Note that DOCKERHUB_TOKEN is really a token for your dockerhub
339+
## account, not your actual dockerhub account password. You can get it
340+
## from https://hub.docker.com/settings/security.
341+
## Check https://github.com/docker/build-push-action/tree/v4.0.0
342+
## for more details.
343+
## Alternatively, try checking
344+
## https://seandavi.github.io/BuildABiocWorkshop/articles/HOWTO_BUILD_WORKSHOP.html.
345+
346+
- name: Build and Push Docker
347+
if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && github.ref == 'refs/heads/devel' && success()"
348+
uses: docker/build-push-action@v4
300349
with:
301-
username: ${{ secrets.DOCKER_USERNAME }}
302-
password: ${{ secrets.DOCKER_PASSWORD }}
303-
repository:
304-
tag_with_ref: true
305-
tag_with_sha: true
306-
tags: latest
350+
context: .
351+
push: true
352+
tags: >
353+
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.CONT_IMG_NAME }}:latest,
354+
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.CONT_IMG_NAME }}:devel

0 commit comments

Comments
 (0)