Skip to content

Commit 8717c46

Browse files
authored
Bioc feedback (#1) (#5)
* Bioc feedback (#1) * ignore yaml files add *.yml to .gitignore so that they are not included in the repo * ignore yaml files add *.yml to .gitignore so that they are not included in the repo * add bioconductor install instructions * update package description to be at least three sentences * remove LazyData: true * ignore rproj * update description and add see_also see_also links to API documentation, package vignette and do_query * add donttest to example Avoid testing the do_query example in case metabolomicsworkbench is down which would cause it to fail and therefore prevent a bioconductor build. * add donttest to example avoid example during testing to prevent error if MB is down * use seq_along and seq_len replace as many cases of 1: as possible with seq_len and seq_along, as per bioconductor guidelines * split lines >80 chars and... also remove donttest and add message to show http status if its an error * add gitlab ci remove appveyor and travis * update readme with gitlab badge * fix gitlab badge url * track yaml for github actions
1 parent 6a801f1 commit 8717c46

File tree

7 files changed

+328
-66
lines changed

7 files changed

+328
-66
lines changed

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: Bug report or feature request
3+
about: Describe a bug you've seen or make a case for a new feature
4+
title: "[BUG] Your bug or feature request"
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
Please briefly describe your problem and what output you expect. If you have a question, please don't use this form. Instead, ask on <https://support.bioconductor.org/> using the appropriate tag(s) including one for this package.
10+
11+
## Context
12+
13+
Provide some context for your bug report or feature request. This could be the:
14+
15+
* link to raw code, example: https://github.com/lcolladotor/osca_LIIGH_UNAM_2020/blob/master/00-template.Rmd#L24-L28
16+
* link to a commit, example: https://github.com/lcolladotor/osca_LIIGH_UNAM_2020/commit/6aa30b22eda614d932c12997ba611ba582c435d7
17+
* link to a line of code inside a commit, example: https://github.com/lcolladotor/osca_LIIGH_UNAM_2020/commit/6aa30b22eda614d932c12997ba611ba582c435d7#diff-e265269fe4f17929940e81341b92b116R17
18+
* link to code from an R package, example: https://github.com/LieberInstitute/spatialLIBD/blob/master/R/run_app.R#L51-L55
19+
20+
## Code
21+
22+
Include the code you ran and comments
23+
24+
```R
25+
## prompt an error
26+
stop('hola')
27+
28+
## check the error trace
29+
traceback()
30+
```
31+
32+
## Small reproducible example
33+
34+
If you copy the lines of code that lead to your error, you can then run [`reprex::reprex()`](https://reprex.tidyverse.org/reference/reprex.html) which will create a small website with code you can then easily copy-paste here in a way that will be easy to work with later on.
35+
36+
```R
37+
## prompt an error
38+
stop('hola')
39+
#> Error in eval(expr, envir, enclos): hola
40+
41+
## check the error trace
42+
traceback()
43+
#> No traceback available
44+
```
45+
46+
47+
## R session information
48+
49+
Remember to include your full R session information.
50+
51+
```R
52+
options(width = 120)
53+
sessioninfo::session_info()
54+
```
55+
56+
The output of `sessioninfo::session_info()` includes relevant GitHub installation information and other details that are missed by `sessionInfo()`.

.github/workflows/check-bioc.yml

Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
## Read more about GitHub actions the features of this GitHub Actions workflow
2+
## at https://lcolladotor.github.io/biocthis/articles/biocthis.html#use_bioc_github_action
3+
##
4+
## For more details, check the biocthis developer notes vignette at
5+
## https://lcolladotor.github.io/biocthis/articles/biocthis_dev_notes.html
6+
##
7+
## You can add this workflow to other packages using:
8+
## > biocthis::use_bioc_github_action()
9+
##
10+
## Using GitHub Actions exposes you to many details about how R packages are
11+
## compiled and installed in several operating system.s
12+
### If you need help, please follow the steps listed at
13+
## https://github.com/r-lib/actions#where-to-find-help
14+
##
15+
## If you found an issue specific to biocthis's GHA workflow, please report it
16+
## with the information that will make it easier for others to help you.
17+
## Thank you!
18+
19+
## Acronyms:
20+
## * GHA: GitHub Action
21+
## * OS: operating system
22+
23+
on:
24+
push:
25+
pull_request:
26+
27+
name: R-CMD-check-bioc
28+
29+
## These environment variables control whether to run GHA code later on that is
30+
## specific to testthat, covr, and pkgdown.
31+
##
32+
## If you need to clear the cache of packages, update the number inside
33+
## cache-version as discussed at https://github.com/r-lib/actions/issues/86.
34+
## Note that you can always run a GHA test without the cache by using the word
35+
## "/nocache" in the commit message.
36+
env:
37+
has_testthat: 'true'
38+
run_covr: 'true'
39+
run_pkgdown: 'false'
40+
has_RUnit: 'false'
41+
cache-version: 'cache-v1'
42+
43+
jobs:
44+
build-check:
45+
runs-on: ${{ matrix.config.os }}
46+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
47+
container: ${{ matrix.config.cont }}
48+
## Environment variables unique to this job.
49+
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
config:
54+
- { os: ubuntu-latest, r: 'devel', bioc: '3.13', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
55+
- { os: macOS-latest, r: 'devel', bioc: '3.13'}
56+
- { os: windows-latest, r: 'devel', bioc: '3.13'}
57+
env:
58+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
59+
RSPM: ${{ matrix.config.rspm }}
60+
NOT_CRAN: true
61+
TZ: UTC
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
64+
65+
steps:
66+
67+
## Set the R library to the directory matching the
68+
## R packages cache step further below when running on Docker (Linux).
69+
- name: Set R Library home on Linux
70+
if: runner.os == 'Linux'
71+
run: |
72+
mkdir /__w/_temp/Library
73+
echo ".libPaths('/__w/_temp/Library')" > ~/.Rprofile
74+
75+
## Most of these steps are the same as the ones in
76+
## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
77+
## If they update their steps, we will also need to update ours.
78+
- name: Checkout Repository
79+
uses: actions/checkout@v2
80+
81+
## R is already included in the Bioconductor docker images
82+
- name: Setup R from r-lib
83+
if: runner.os != 'Linux'
84+
uses: r-lib/actions/setup-r@master
85+
with:
86+
r-version: ${{ matrix.config.r }}
87+
88+
## pandoc is already included in the Bioconductor docker images
89+
- name: Setup pandoc from r-lib
90+
if: runner.os != 'Linux'
91+
uses: r-lib/actions/setup-pandoc@master
92+
93+
- name: Query dependencies
94+
run: |
95+
install.packages('remotes')
96+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
97+
shell: Rscript {0}
98+
99+
- name: Cache R packages
100+
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os != 'Linux'"
101+
uses: actions/cache@v2
102+
with:
103+
path: ${{ env.R_LIBS_USER }}
104+
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel-${{ hashFiles('.github/depends.Rds') }}
105+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel-
106+
107+
- name: Cache R packages on Linux
108+
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os == 'Linux' "
109+
uses: actions/cache@v2
110+
with:
111+
path: /home/runner/work/_temp/Library
112+
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel-${{ hashFiles('.github/depends.Rds') }}
113+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-devel-r-devel-
114+
115+
- name: Install Linux system dependencies
116+
if: runner.os == 'Linux'
117+
run: |
118+
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 = " "))')
119+
echo $sysreqs
120+
sudo -s eval "$sysreqs"
121+
122+
- name: Install macOS system dependencies
123+
if: matrix.config.os == 'macOS-latest'
124+
run: |
125+
## Enable installing XML from source if needed
126+
brew install libxml2
127+
echo "XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config" >> $GITHUB_ENV
128+
129+
## Required to install magick as noted at
130+
## https://github.com/r-lib/usethis/commit/f1f1e0d10c1ebc75fd4c18fa7e2de4551fd9978f#diff-9bfee71065492f63457918efcd912cf2
131+
brew install imagemagick@6
132+
133+
## For textshaping, required by ragg, and required by pkgdown
134+
brew install harfbuzz fribidi
135+
136+
## For installing usethis's dependency gert
137+
brew install libgit2
138+
139+
- name: Install Windows system dependencies
140+
if: runner.os == 'Windows'
141+
run: |
142+
## Edit below if you have any Windows system dependencies
143+
shell: Rscript {0}
144+
145+
- name: Install BiocManager
146+
run: |
147+
message(paste('****', Sys.time(), 'installing BiocManager ****'))
148+
remotes::install_cran("BiocManager")
149+
shell: Rscript {0}
150+
151+
- name: Set BiocVersion
152+
run: |
153+
BiocManager::install(version = "${{ matrix.config.bioc }}", ask = FALSE)
154+
shell: Rscript {0}
155+
156+
- name: Install dependencies pass 1
157+
run: |
158+
## Try installing the package dependencies in steps. First the local
159+
## dependencies, then any remaining dependencies to avoid the
160+
## issues described at
161+
## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html
162+
## https://github.com/r-lib/remotes/issues/296
163+
## Ideally, all dependencies should get installed in the first pass.
164+
165+
## Pass #1 at installing dependencies
166+
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****'))
167+
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE)
168+
continue-on-error: true
169+
shell: Rscript {0}
170+
171+
- name: Install dependencies pass 2
172+
run: |
173+
## Pass #2 at installing dependencies
174+
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****'))
175+
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE)
176+
177+
## For running the checks
178+
message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****'))
179+
remotes::install_cran("rcmdcheck")
180+
BiocManager::install("BiocCheck")
181+
shell: Rscript {0}
182+
183+
- name: Install BiocGenerics
184+
if: env.has_RUnit == 'true'
185+
run: |
186+
## Install BiocGenerics
187+
BiocManager::install("BiocGenerics")
188+
shell: Rscript {0}
189+
190+
- name: Install covr
191+
if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'Linux'
192+
run: |
193+
remotes::install_cran("covr")
194+
shell: Rscript {0}
195+
196+
- name: Install pkgdown
197+
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
198+
run: |
199+
remotes::install_github("r-lib/pkgdown")
200+
shell: Rscript {0}
201+
202+
- name: Session info
203+
run: |
204+
options(width = 100)
205+
pkgs <- installed.packages()[, "Package"]
206+
sessioninfo::session_info(pkgs, include_base = TRUE)
207+
shell: Rscript {0}
208+
209+
- name: Run CMD check
210+
env:
211+
_R_CHECK_CRAN_INCOMING_: false
212+
run: |
213+
rcmdcheck::rcmdcheck(
214+
args = c("--no-build-vignettes", "--no-manual", "--timings"),
215+
build_args = c("--no-manual", "--no-resave-data"),
216+
error_on = "warning",
217+
check_dir = "check"
218+
)
219+
shell: Rscript {0}
220+
221+
## Might need an to add this to the if: && runner.os == 'Linux'
222+
- name: Reveal testthat details
223+
if: env.has_testthat == 'true'
224+
run: find . -name testthat.Rout -exec cat '{}' ';'
225+
226+
- name: Run RUnit tests
227+
if: env.has_RUnit == 'true'
228+
run: |
229+
BiocGenerics:::testPackage()
230+
shell: Rscript {0}
231+
232+
- name: Run BiocCheck
233+
run: |
234+
BiocCheck::BiocCheck(
235+
dir('check', 'tar.gz$', full.names = TRUE),
236+
`quit-with-status` = TRUE,
237+
`no-check-R-ver` = TRUE,
238+
`no-check-bioc-help` = TRUE
239+
)
240+
shell: Rscript {0}
241+
242+
- name: Test coverage
243+
if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'Linux'
244+
run: |
245+
covr::codecov()
246+
shell: Rscript {0}
247+
248+
- name: Install package
249+
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
250+
run: R CMD INSTALL .
251+
252+
- name: Deploy package
253+
if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux'
254+
run: |
255+
git config --local user.email "[email protected]"
256+
git config --local user.name "GitHub Actions"
257+
Rscript -e "pkgdown::deploy_to_branch(new_process = FALSE)"
258+
shell: bash {0}
259+
## Note that you need to run pkgdown::deploy_to_branch(new_process = FALSE)
260+
## at least one locally before this will work. This creates the gh-pages
261+
## branch (erasing anything you haven't version controlled!) and
262+
## makes the git history recognizable by pkgdown.
263+
264+
- name: Upload check results
265+
if: failure()
266+
uses: actions/upload-artifact@master
267+
with:
268+
name: ${{ runner.os }}-biocversion-devel-r-devel-results
269+
path: check

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,5 @@ doc
4444
Meta
4545

4646
# yaml
47-
*.yml
4847
*.Rproj
49-
*.yml
50-
.travis.yml
51-
codecov.yml
52-
appveyor.yml
48+

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
<!-- badges: start -->
3-
[![Travis build status](https://travis-ci.com/computational-metabolomics/metabolomicsWorkbenchR.svg?branch=master)](https://travis-ci.com/computational-metabolomics/metabolomicsWorkbenchR)
4-
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/computational-metabolomics/metabolomicsWorkbenchR?branch=master&svg=true)](https://ci.appveyor.com/project/RJMW/metabolomicsWorkbenchR)
3+
[![Build Status](https://github.com/computational-metabolomics/metabolomicsWorkbenchR/workflows/metabolomicsWorkbenchR/badge.svg)](https://github.com/computational-metabolomics/metabolomicsWorkbenchR/actions)
54
[![Codecov test coverage](https://codecov.io/gh/computational-metabolomics/metabolomicsWorkbenchR/branch/master/graph/badge.svg)](https://codecov.io/gh/computational-metabolomics/metabolomicsWorkbenchR?branch=master)
65
<!-- badges: end -->
76

0 commit comments

Comments
 (0)