Skip to content

Commit 625d554

Browse files
committed
fix and simplify R-CMD-check-bioc workflow
1 parent 90a9999 commit 625d554

1 file changed

Lines changed: 3 additions & 163 deletions

File tree

.github/workflows/check-bioc.yml

Lines changed: 3 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ name: R-CMD-check-bioc
3535
## "/nocache" in the commit message.
3636
env:
3737
has_testthat: 'true'
38-
run_covr: 'false'
39-
run_pkgdown: 'false'
40-
has_RUnit: 'false'
4138
cache-version: 'cache-v1'
4239
run_docker: 'false'
4340

@@ -52,9 +49,9 @@ jobs:
5249
fail-fast: false
5350
matrix:
5451
config:
55-
- { os: ubuntu-latest, r: '4.5', bioc: '3.21', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest" }
56-
- { os: macOS-latest, r: '4.5', bioc: '3.21'}
57-
- { os: windows-latest, r: '4.5', bioc: '3.21'}
52+
- { os: ubuntu-latest, r: '4.5', bioc: '3.22', cont: "bioconductor/bioconductor_docker:RELEASE_3_22", rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest" }
53+
- { os: macOS-latest, r: '4.5', bioc: '3.22'}
54+
- { os: windows-latest, r: '4.5', bioc: '3.22'}
5855
## Check https://github.com/r-lib/actions/tree/master/examples
5956
## for examples using the http-user-agent
6057
env:
@@ -100,46 +97,13 @@ jobs:
10097
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
10198
shell: Rscript {0}
10299

103-
- name: Restore R package cache
104-
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os != 'Linux'"
105-
uses: actions/cache@v3
106-
with:
107-
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-
110-
111-
- name: Cache R packages on Linux
112-
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os == 'Linux' "
113-
uses: actions/cache@v3
114-
with:
115-
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-
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"
125-
126100
- name: Install macOS system dependencies
127101
if: matrix.config.os == 'macOS-latest'
128102
run: |
129103
## Enable installing XML from source if needed
130104
brew install libxml2
131105
echo "XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config" >> $GITHUB_ENV
132106
133-
## Required to install magick as noted at
134-
## https://github.com/r-lib/usethis/commit/f1f1e0d10c1ebc75fd4c18fa7e2de4551fd9978f#diff-9bfee71065492f63457918efcd912cf2
135-
brew install imagemagick@6
136-
137-
## For textshaping, required by ragg, and required by pkgdown
138-
brew install harfbuzz fribidi
139-
140-
## For installing usethis's dependency gert
141-
brew install libgit2
142-
143107
## Required for tcltk
144108
brew install xquartz --cask
145109
@@ -186,25 +150,6 @@ jobs:
186150
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE, force = TRUE)
187151
shell: Rscript {0}
188152

189-
- name: Install BiocGenerics
190-
if: env.has_RUnit == 'true'
191-
run: |
192-
## Install BiocGenerics
193-
BiocManager::install("BiocGenerics")
194-
shell: Rscript {0}
195-
196-
- name: Install covr
197-
if: github.ref == 'refs/heads/devel' && env.run_covr == 'true' && runner.os == 'Linux'
198-
run: |
199-
remotes::install_cran("covr")
200-
shell: Rscript {0}
201-
202-
- name: Install pkgdown
203-
if: github.ref == 'refs/heads/devel' && env.run_pkgdown == 'true' && runner.os == 'Linux'
204-
run: |
205-
remotes::install_github("r-lib/pkgdown")
206-
shell: Rscript {0}
207-
208153
- name: Session info
209154
run: |
210155
options(width = 100)
@@ -231,108 +176,3 @@ jobs:
231176
if: env.has_testthat == 'true'
232177
run: find . -name testthat.Rout -exec cat '{}' ';'
233178

234-
- name: Run RUnit tests
235-
if: env.has_RUnit == 'true'
236-
run: |
237-
BiocGenerics:::testPackage()
238-
shell: Rscript {0}
239-
240-
- name: Run BiocCheck
241-
env:
242-
DISPLAY: 99.0
243-
run: |
244-
BiocCheck::BiocCheck(
245-
dir('check', 'tar.gz$', full.names = TRUE),
246-
`quit-with-status` = TRUE,
247-
`no-check-R-ver` = TRUE,
248-
`no-check-bioc-help` = TRUE
249-
)
250-
shell: Rscript {0}
251-
252-
- name: Test coverage
253-
if: github.ref == 'refs/heads/devel' && env.run_covr == 'true' && runner.os == 'Linux'
254-
run: |
255-
covr::codecov(coverage = covr::package_coverage(type = "all"))
256-
shell: Rscript {0}
257-
258-
- name: Install package
259-
if: github.ref == 'refs/heads/devel' && env.run_pkgdown == 'true' && runner.os == 'Linux'
260-
run: R CMD INSTALL .
261-
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}
266-
## Note that you need to run pkgdown::deploy_to_branch(new_process = FALSE)
267-
## at least one locally before this will work. This creates the gh-pages
268-
## branch (erasing anything you haven't version controlled!) and
269-
## makes the git history recognizable by pkgdown.
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-
284-
- name: Upload check results
285-
if: failure()
286-
uses: actions/upload-artifact@master
287-
with:
288-
name: ${{ runner.os }}-biocversion-devel-r-devel-results
289-
path: check
290-
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
333-
with:
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)