diff --git a/.Rbuildignore b/.Rbuildignore index 6f3e229e..7d008482 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -10,6 +10,8 @@ rworkflows-merged ^reports ^inst/hex$ ^hex$ +.*\.pdf$ +^CITATION$ .*\.Rproj$ ^\.Rproj\.user$ diff --git a/.Rhistory b/.Rhistory index 2fe33fb2..2984694b 100644 --- a/.Rhistory +++ b/.Rhistory @@ -1,9 +1,3 @@ -library(rworkflows) -use_vignette_docker(force_new = T) -use_vignette_docker("neurogenomics",force_new = T) -library(rworkflows) -use_vignette_docker("neurogenomics",force_new = T) -library(rworkflows) use_vignette_docker("neurogenomics",force_new = T) cont library(rworkflows) @@ -510,3 +504,9 @@ library(rworkflows) devtools::build_manual() devtools::build_manual(path = 'inst') ## Bug fixes +testthat::test_check() +testthat::test_check("rworkflows") +?rstatix::anova_test +?rstatix::Anova() +?) +?rstatix::cor_pmat diff --git a/DESCRIPTION b/DESCRIPTION index 837f0a47..d5ec1723 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rworkflows Type: Package Title: Test, Document, Containerise, and Deploy R Packages -Version: 1.0.1 +Version: 1.0.2 Authors@R: c(person(given = "Brian", family = "Schilder", @@ -59,7 +59,8 @@ Suggests: BiocPkgTools, biocViews, reticulate, - rvest + rvest, + tinytex VignetteBuilder: knitr License: GPL-3 Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index 9883f782..9bee2fa0 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -6,6 +6,10 @@ export(construct_authors) export(construct_conda_yml) export(construct_cont) export(construct_runners) +export(dependencies_latex) +export(dependencies_linux) +export(dependencies_macos) +export(dependencies_windows) export(dt_to_desc) export(fill_description) export(get_description) diff --git a/NEWS.md b/NEWS.md index 077aa21b..e6aed19e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,26 @@ +# rworkflows 1.0.2 + +## New features + +* *action.yml* + - Condense steps + - Use new `rworkflows` funcs to specific system and latex deps +* *Dockerfile* + - Use new `rworkflows` funcs to specific system and latex deps +* New functions: + - `dependencies_linux` + - `dependencies_macos` + - `dependencies_windows` + - `dependencies_latex` +* README: update and condense. + +## Bug fixes + +* Get rid of CRAN NOTE by reducing package size: + - Remove unused *inst* files. + - Change vignettes to use `rmarkdown::render` instead of `BiocStyle::html_document`. + - Add to *.Rbuildignore*: .`*\.pdf$`, `^CITATION$` + # rworkflows 1.0.1 ## New features @@ -9,7 +32,7 @@ - *action.yml* - `repository: ${{ github.repository }}` --> `repository: ${{ env.packageName }}` - Add `env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}` to any checking steps - (allows piggyback to download data from Relesases) + (allows piggyback to download data from Releases) # rworkflows 1.0.0 diff --git a/R/dependencies_latex.R b/R/dependencies_latex.R new file mode 100644 index 00000000..c2aee7c4 --- /dev/null +++ b/R/dependencies_latex.R @@ -0,0 +1,48 @@ +#' Latex dependencies +#' +#' Install extra latex package dependencies. +#' @param install Install the packages with \link[tinytex]{tlmgr_install} +#' (\code{TRUE}). Otherwise, return a character vector of the packages to +#' install. +#' @inheritParams dependencies_linux +#' @inheritDotParams tinytex::tlmgr_install +#' @returns A character vector of extra latex packages. +#' +#' @export +#' @examples +#' dependencies_latex(install=FALSE) +dependencies_latex <- function(extra=c("bera", + "nowidow", + "parnotes", + "marginfix", + "etoolbox", + "titlesec", + "sectsty", + "framed", + "enumitem", + "parskip", + "soul", + "placeins", + "footmisc", + "changepage", + "xstring", + "caption", + "mathtools", + "fancyhdr", + "preprint", + "ragged2e", + "pdfcrop", + "titling", + "silence", + "everysel"), + install=TRUE, + ...){ + requireNamespace("tinytex") + + if(isTRUE(install)){ + tinytex::tlmgr_install(pkgs = unique(extra), + ...) + } else { + extra + } +} \ No newline at end of file diff --git a/R/dependencies_linux.R b/R/dependencies_linux.R new file mode 100644 index 00000000..e2ee3855 --- /dev/null +++ b/R/dependencies_linux.R @@ -0,0 +1,38 @@ +#' Linux dependencies +#' +#' Construct a command to install system dependencies for the +#' Linux OS environment. +#' Includes all dependencies listed by \link[remotes]{system_requirements}, +#' in addition to user-specified dependencies via \code{extra}. +#' @param prefix Prefix to prepend to the command. +#' @param extra Additional dependencies to install. +#' @param verbose Print messages. +#' @inheritParams remotes::system_requirements +#' @inheritDotParams remotes::system_requirements +#' @returns Command to install system dependencies. +#' +#' @export +#' @examples +#' dependencies_linux(package="rworkflows") +dependencies_linux <- function(os = "ubuntu", + os_release = "20.04", + extra=c("qpdf", + "rsync"), + prefix=paste("apt-get update -y", + "apt-get install -y", + sep=" && "), + verbose = TRUE, + ... + ){ + # devoptera::args2vars(linux_dependencies) + + deps <- gsub("apt-get install -y ", "", + remotes::system_requirements(os = os, + os_release = os_release, + ...) + ) + deps <- unique(c(deps,extra)) + cmd <- paste(prefix,paste(deps,collapse = " ")) + messager(cmd,v=verbose) + cat(cmd) +} diff --git a/R/dependencies_macos.R b/R/dependencies_macos.R new file mode 100644 index 00000000..db0c6481 --- /dev/null +++ b/R/dependencies_macos.R @@ -0,0 +1,53 @@ +#' MacOS dependencies +#' +#' Construct a command to install system dependencies for the +#' Mac OS environment. +#' +#'### --- Justifications for each package --- #### +#'## libxml2 ### +#' Enable installing XML from source if needed +#'## imagemagick@6 ### +#' Required to install magick as noted at +#' https://github.com/r-lib/usethis/commit/f1f1e0d10c1ebc75fd4c18fa7e2de4551fd9978f#diff-9bfee71065492f63457918efcd912cf2 +#'## harfbuzz fribidi ### +#' For textshaping, required by ragg, and required by pkgdown +#'## libgit2 ### +#' For installing usethis's dependency gert +#'## xquartz --cask ### +#' Required for tcltk +#'## libxfont ### +#' Required for some ggplot2 functions +#'## texlive ### +#' Required for rendering Sweave files (even with r-lib/actions/setup-tinytex) +#' @param cask Additional dependencies to install via cask. +#' @inheritParams dependencies_linux +#' @returns Command to install system dependencies. +#' +#' @export +#' @examples +#' dependencies_macos() +dependencies_macos <- function(extra=c("libxml2", + "harfbuzz", + "fribidi", + "libgit2", + "texlive", + "imagemagick@6", + "rsync"), + cask = c("xquartz"), + prefix="brew install", + verbose=TRUE){ + # devoptera::args2vars(macos_dependencies) + + ### Install normally ### + cmd <- paste(prefix,paste(extra,collapse=" ")) + ### Install via cask ### + if(length(cask) > 0){ + cmd <- paste( + cmd, + paste(prefix,paste(cask,collapse=" "),"--cask"), + sep=" && " + ) + } + messager(cmd,v=verbose) + cat(cmd) +} diff --git a/R/dependencies_windows.R b/R/dependencies_windows.R new file mode 100644 index 00000000..8e0123a5 --- /dev/null +++ b/R/dependencies_windows.R @@ -0,0 +1,19 @@ +#' Windows dependencies +#' +#' Construct a command to install system dependencies for the +#' Windows environment. +#' @inheritParams dependencies_linux +#' @returns Command to install system dependencies. +#' +#' @export +#' @examples +#' dependencies_windows() +dependencies_windows <- function(extra=c("curl"), + prefix="npm install", + verbose=TRUE){ + # devoptera::args2vars(windows_dependencies) + + cmd <- paste(prefix,paste(extra,collapse=" ")) + messager(cmd,v=verbose) + cat(cmd) +} diff --git a/R/use_vignette_docker.R b/R/use_vignette_docker.R index a3f0e576..fa2d8f5a 100644 --- a/R/use_vignette_docker.R +++ b/R/use_vignette_docker.R @@ -54,7 +54,7 @@ use_vignette_docker <- function(package = names(get_description()), "vignettes", "docker.Rmd"), output=list( - "BiocStyle::html_document"= list( + "rmarkdown::html_document"= list( "md_extensions"="-autolink_bare_uris" ) ), diff --git a/R/use_vignette_getstarted.R b/R/use_vignette_getstarted.R index 53b2a289..c531598c 100644 --- a/R/use_vignette_getstarted.R +++ b/R/use_vignette_getstarted.R @@ -19,7 +19,7 @@ use_vignette_getstarted <- function(package = names(get_description()), path=file.path(save_dir, "vignettes", paste0(package,".Rmd")), - output="BiocStyle::html_document", + output="rmarkdown::html_document", force_new=FALSE, show=FALSE, verbose=TRUE){ diff --git a/README.Rmd b/README.Rmd index 580d1eb2..ace6070e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -9,8 +9,16 @@ output: ```{r setup, include=FALSE} pkg <- read.dcf("DESCRIPTION", fields = "Package")[1] ``` +## ๐Ÿ“˜ Citation -## Intro +If you use of reference the ``r pkg`` suite, please cite: + + +> `r utils::citation(pkg)$textVersion` + +## โ„น Intro + +### ๐Ÿ“– Background `rworkflows` is a suite of tools to make it easy for R developers to implement reproducible best practices on GitHub. @@ -21,7 +29,7 @@ It includes three main components: set up short, customisable workflows that trigger the `rworkflows` action. 3. [**`rworkflows` action**](https://github.com/neurogenomics/rworkflows/blob/master/action.yml): an open-source action available on the [GitHub Actions Marketplace](https://github.com/marketplace/actions/rworkflows). -### `rworkflows` action steps +### โš™๏ธ `rworkflows` action steps [**GitHub Actions**](https://docs.github.com/en/actions) are a powerful way to automatically launch workflows @@ -60,144 +68,96 @@ This means you won't have to manually edit any yaml files, just run the `rworkflows::use_workflow()` function and you're ready to go within seconds! -> **Note**: `rworkflows` uses, was inspired by, and benefits from the work of many other projects, especially: -[`biocthis`](https://github.com/lcolladotor/biocthis), [`usethis`](https://github.com/r-lib/usethis), [`actions/`](https://github.com/actions), [`r-lib/actions`](https://github.com/r-lib/actions), [`bioc-actions`](https://github.com/grimbough/bioc-actions), [`JamesIves/github-pages-deploy-action`](https://github.com/JamesIves/github-pages-deploy-action), [`docker/build-push-action`](https://github.com/docker/build-push-action), [`bioconductor_docker`](https://github.com/Bioconductor/bioconductor_docker). For more details on how these projects relate to `rworkflows`, please see [below](#acknowledgments). +> **๐Ÿ™ Acknowledgements**: `rworkflows` uses, was inspired by, and benefits from the work of [many other projects](#acknowledgments), especially: [`biocthis`](https://github.com/lcolladotor/biocthis), [`usethis`](https://github.com/r-lib/usethis), [`actions/`](https://github.com/actions), [`r-lib/actions`](https://github.com/r-lib/actions), [`bioc-actions`](https://github.com/grimbough/bioc-actions), [`JamesIves/github-pages-deploy-action`](https://github.com/JamesIves/github-pages-deploy-action), [`docker/build-push-action`](https://github.com/docker/build-push-action), [`bioconductor_docker`](https://github.com/Bioconductor/bioconductor_docker). -## Quickstart +## โฉ Quickstart Install and create the workflow in your R package's project folder. +In R (only need to do once per repository): ```R -## in R - -#### Install rworkflows R package #### -### For the stable CRAN release +### 1. Install stable CRAN release if(!require("rworkflows")) install.packages("rworkflows") - -### Or, for the latest development version +### Or, install latest development version # if(!require("rworkflows")) remotes::install_github("neurogenomics/rworkflows") -### Create workflow file +### 2. Create workflow file path <- rworkflows::use_workflow() ``` -Push to GitHub, and let everything else run automatically! -You can check the status of your workflow by clicking on the *Actions* tab -in your GitHub repo. +Then, in the Terminal: ```bash -## in the Terminal +### 3. Push to GitHub git add . -git commit -m "Added rworkflows" +git commit -m "Added rworkflows" # Arbitrary commit message git push ``` -**Note**: If you want to skip running **GitHub Actions** on a particular push, -simply add "[skip ci]" somewhere in the commit message, e.g.: -`git commit -m "Update README [skip ci]"` - -## Documentation - -### [Vignettes](https://neurogenomics.github.io/rworkflows/articles/) - -#### [Get started](https://neurogenomics.github.io/rworkflows/articles/rworkflows.html) -Introductory vignette for using `rworkflows`. - -#### [Docker/Singularity](https://neurogenomics.github.io/rworkflows/articles/docker) -Copy-and-paste instructions for creating a **Docker** or **Singularity** container -with the `rworkflows` R package pre-installed. - -#### [Dependency graph](https://neurogenomics.github.io/rworkflows/articles/depgraph). -Interactive graph showing all the GitHub repos that currently use -the `rworkflows` action. - -### [Videos](https://www.youtube.com/@NeurogenomicsLab) +Now you can let everything run on GitHub automatically! +You can check the status of your workflow by clicking on the [*Actions* tab](https://github.com/neurogenomics/rworkflows/actions) +in your GitHub repo. -#### [rworkflows: taming the Wild West of R packages](https://youtu.be/nLIG2prEmCg) -Talk on the background, motivation, and utility of `rworkflows`. +### ๐Ÿคซ Special commit messages +Including special keywords in your commit message will have a certain effect: +- `"[skip ci]"`: will skip running the workflow on this push. +- `"[nodocker]"`: will skip any Docker registry steps. +- `"[noncache]"`: will not use any cached installations or files. -#### [Getting into the flow with rworkflows: an introductory tutorial](https://youtu.be/vcpMsil3EAU) -Step-by-step tutorial showing how to use `rworkflows` in an R package. +For example: `git commit -m "Update README [skip ci]"` will skip running any GitHub Actions. -### GitHub Secrets +### ๐Ÿ” GitHub Secrets To use certain features of `rworkflows`, you may need to set up one or more [GitHub Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets): * `PAT_GITHUB` [Optional]: Can grant access to private repos on GitHub Actions. You can generate your very own Personal - Authentication Token with `usethis::create_github_token()`. See the [GitHub docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for details. + Authentication Token with `usethis::create_github_token()`. [See more](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). * `DOCKER_TOKEN` [Optional]: Allows GitHub Actions to push to a - [DockerHub](https://hub.docker.com) account. + [DockerHub](https://hub.docker.com) account. [See more](https://docs.docker.com/security/for-developers/access-tokens/). +* `CODECOV_TOKEN` [Optional]: Bypasses issues that occasionally arise from GitHub API limits. [See more](https://docs.codecov.com/reference/overview). -## Citation +## ๐Ÿ“š Documentation -If you use ``r pkg``, please cite: +### [๐Ÿง‘โ€๐ŸŽ“ Vignettes](https://neurogenomics.github.io/rworkflows/articles/) - -> `r utils::citation(pkg)$textVersion` +- [๐Ÿ“– **Get started**](https://neurogenomics.github.io/rworkflows/articles/rworkflows.html): Introductory vignette for using `rworkflows`. +- [๐Ÿณ **Docker/Singularity**](https://neurogenomics.github.io/rworkflows/articles/docker): Copy-and-paste instructions for creating a **Docker** or **Singularity** container with the `rworkflows` R package pre-installed. +- [๐Ÿ•ธ๏ธ **Dependency graph**](https://neurogenomics.github.io/rworkflows/articles/depgraph): Interactive graph showing all the GitHub repos that currently use +the `rworkflows` action. -## Acknowledgments -`rworkflows` builds upon the work of many others, especially the following: +### [๐ŸŽฅ Videos](https://www.youtube.com/@NeurogenomicsLab) + +- [๐Ÿค  **rworkflows: taming the Wild West of R packages**](https://youtu.be/nLIG2prEmCg): Talk on the background, motivation, and utility of `rworkflows`. +- [๐ŸŒŠ **Getting into the flow with rworkflows: an introductory tutorial**](https://youtu.be/vcpMsil3EAU): Step-by-step tutorial showing how to use `rworkflows` in an R package. -### [`biocthis`](https://github.com/lcolladotor/biocthis) -This workflow is largely inspired by the workflow generated by the -[`use_bioc_github_action()`](https://lcolladotor.github.io/biocthis/articles/biocthis.html) function within the -[`biothis`]( https://www.bioconductor.org/packages/release/bioc/html/biocthis.html) -package, developed by @lcolladotor. +## ๐Ÿ™ Acknowledgments +`rworkflows` builds upon the work of many others, especially the following: -#### Key changes in `rworkflows` -- Uses dynamic variables to specify R/Bioconductor versions +- [`biocthis`](https://github.com/lcolladotor/biocthis): This workflow is largely inspired by the workflow generated by the +[`use_bioc_github_action()`](https://lcolladotor.github.io/biocthis/articles/biocthis.html) function within the [`biothis`]( https://www.bioconductor.org/packages/release/bioc/html/biocthis.html) +package, developed by @lcolladotor. Key changes in `rworkflows` + - Uses dynamic variables to specify R/Bioconductor versions (e.g. `r: "latest"`) and the name of your R package, as opposed to static names that are likely to become outdated (e.g. `r: "4.0.1"`). -- Additional error handling and dependencies checks. -- Re-renders `README.Rmd` before rebuilding the documentation website. - -### [`usethis`](https://github.com/r-lib/usethis) -`biocthis` was in turn inspired by `usethis`. - -### [`actions/`](https://github.com/actions) -A general set of **GitHub Actions** maintained by the core GitHub team. - -### [`r-lib/actions`](https://github.com/r-lib/actions) -A set of **GitHub Actions** for R development maintained by the Rstudio/Posit team. - -### [`bioc-actions`](https://github.com/grimbough/bioc-actions) -[Bioconductor](https://www.bioconductor.org/)-oriented **GitHub Actions** created by @grimbough. - -### [`JamesIves/github-pages-deploy-action`](https://github.com/JamesIves/github-pages-deploy-action) -Builds and deploys the **GitHub Pages** documentation website -in the `rworkflows` GHA workflows. - -### [`docker/build-push-action`](https://github.com/docker/build-push-action) -A set of **GitHub Actions** for building/pushing **Docker** containers. - -### [`bioconductor_docker`](https://github.com/Bioconductor/bioconductor_docker) -Uses the official -[`bioconductor/bioconductor_docker`](https://github.com/Bioconductor/bioconductor_docker) -**Docker** container. - -**NOTE**: Whenever a new version of Bioconductor is released, -the `bioconductor/bioconductor_docker` container will often lag behind the actual Bioconductor releases -for up to several days, due to the time it takes to update the container. -This means that sometimes "devel" in `Bioconductor/bioconductor_docker` is actually referring to the current "release" version of Bioconductor (i.e. the previous Bioc version's "devel"). -For further details, see this [Issue](https://github.com/Bioconductor/bioconductor_docker/issues/37), and the [Bioconductor release schedule](https://www.bioconductor.org/about/release-announcements/). - -### [`scFlow`](https://github.com/combiz/scFlow) -This Dockerfile was partly adapted from the [scFlow Dockerfile](https://github.com/combiz/scFlow/blob/master/Dockerfile). -Unlike other Dockerfiles, this one -**does not require any manual editing when applying to different R packages**. -This means that users who are unfamiliar with **Docker** do not have to troubleshoot -making this file correctly. It also means that it will continue to work -even if your R package dependencies change. - -### [`act`](https://github.com/nektos/act) -A very useful command line tool for testing **GitHub Actions** locally. - -### [`actions/runner-images`](https://github.com/actions/runner-images) -Runner images for each OS provided by GitHub. - -### [`actions/setup-miniconda`](https://github.com/marketplace/actions/setup-miniconda) -GitHub Action to setup Miniconda and conda environments. - -# Session Info + - Additional error handling and dependencies checks. + - Re-renders `README.Rmd` before rebuilding the documentation website. + - Conda support + - Ability to change registry +- [`usethis`](https://github.com/r-lib/usethis): `biocthis` was in turn inspired by `usethis`. +- [`actions/`](https://github.com/actions): A general set of **GitHub Actions** maintained by the core GitHub team. +- [`r-lib/actions`](https://github.com/r-lib/actions): A set of **GitHub Actions** for R development maintained by the Rstudio/Posit team. +- [`bioc-actions`](https://github.com/grimbough/bioc-actions) +[Bioconductor](https://www.bioconductor.org/)-oriented **GitHub Actions** created by @grimbough. +- [`JamesIves/github-pages-deploy-action`](https://github.com/JamesIves/github-pages-deploy-action): Builds and deploys the **GitHub Pages** documentation website +in the `rworkflows` GHA workflows. +- [`docker/build-push-action`](https://github.com/docker/build-push-action): A set of **GitHub Actions** for building/pushing **Docker** containers. +- [`bioconductor_docker`](https://github.com/Bioconductor/bioconductor_docker): Uses the official [`bioconductor/bioconductor_docker`](https://github.com/Bioconductor/bioconductor_docker) **Docker** container. + - **Note**: Whenever a new version of Bioconductor is released, the `bioconductor/bioconductor_docker` container will often lag behind the actual. Bioconductor releases for up to several days, due to the time it takes to update the container. This means that sometimes "devel" in `Bioconductor/bioconductor_docker` is actually referring to the current "release" version of Bioconductor (i.e. the previous Bioc version's "devel"). For further details, see this [Issue](https://github.com/Bioconductor/bioconductor_docker/issues/37), and the [Bioconductor release schedule](https://www.bioconductor.org/about/release-announcements/). +- [`scFlow`](https://github.com/combiz/scFlow): The `rworkflows` Dockerfile template was partly adapted from the [scFlow Dockerfile](https://github.com/combiz/scFlow/blob/master/Dockerfile). Unlike other Dockerfiles, this one does not require any manual editing when applying to different R packages. This means that users who are unfamiliar with **Docker** do not have to troubleshoot making this file correctly. It also means that it will continue to work even if your R package dependencies change. +- [`act`](https://github.com/nektos/act): A very useful command line tool for testing **GitHub Actions** locally. +- [`actions/runner-images`](https://github.com/actions/runner-images): Runner images for each OS provided by GitHub. +- [`actions/setup-miniconda`](https://github.com/marketplace/actions/setup-miniconda): GitHub Action to setup Miniconda and conda environments. + +## โ„น Session Info
diff --git a/README.md b/README.md index 62686049..8e7cacb9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ checks](https://badges.cranchecks.info/summary/rworkflows.svg)](https://cran.r-p GPL-3](https://img.shields.io/badge/license-GPL--3-blue.svg)](https://cran.r-project.org/web/licenses/GPL-3) [![](https://img.shields.io/badge/doi-https://doi.org/10.5281/zenodo.10048573-blue.svg)](https://doi.org/https://doi.org/10.5281/zenodo.10048573)
-[![](https://img.shields.io/badge/devel%20version-1.0.0-black.svg)](https://github.com/neurogenomics/rworkflows) +[![](https://img.shields.io/badge/devel%20version-1.0.2-black.svg)](https://github.com/neurogenomics/rworkflows) [![](https://img.shields.io/github/languages/code-size/neurogenomics/rworkflows.svg)](https://github.com/neurogenomics/rworkflows) [![](https://img.shields.io/github/last-commit/neurogenomics/rworkflows.svg)](https://github.com/neurogenomics/rworkflows/commits/master)
[![R build @@ -24,10 +24,24 @@ status](https://github.com/neurogenomics/rworkflows/workflows/rworkflows_dev/bad Authors: Brian Schilder, Alan Murphy, Nathan Skene

-README updated: Nov-02-2023 +README updated: Nov-16-2023

-## Intro +## ๐Ÿ“˜ Citation + +If you use of reference the `rworkflows` suite, please cite: + + + +> Brian M. Schilder, Alan E. Murphy, & Nathan G. Skene (2023) The +> rworkflows suite: automated continuous integration for quality +> checking, documentation website creation, and containerised deployment +> of R packages, *Research Square*; +> + +## โ„น Intro + +### ๐Ÿ“– Background `rworkflows` is a suite of tools to make it easy for R developers to implement reproducible best practices on GitHub. @@ -46,7 +60,7 @@ action**](https://github.com/neurogenomics/rworkflows/blob/master/action.yml): an open-source action available on the [GitHub Actions Marketplace](https://github.com/marketplace/actions/rworkflows). -### `rworkflows` action steps +### โš™๏ธ `rworkflows` action steps [**GitHub Actions**](https://docs.github.com/en/actions) are a powerful way to automatically launch workflows every time you push changes to a @@ -93,9 +107,9 @@ out-of-the-box. This means you wonโ€™t have to manually edit any yaml files, just run the `rworkflows::use_workflow()` function and youโ€™re ready to go within seconds! -> **Note**: `rworkflows` uses, was inspired by, and benefits from the -> work of many other projects, especially: -> [`biocthis`](https://github.com/lcolladotor/biocthis), +> **๐Ÿ™ Acknowledgements**: `rworkflows` uses, was inspired by, and +> benefits from the work of [many other projects](#acknowledgments), +> especially: [`biocthis`](https://github.com/lcolladotor/biocthis), > [`usethis`](https://github.com/r-lib/usethis), > [`actions/`](https://github.com/actions), > [`r-lib/actions`](https://github.com/r-lib/actions), @@ -103,71 +117,49 @@ ready to go within seconds! > [`JamesIves/github-pages-deploy-action`](https://github.com/JamesIves/github-pages-deploy-action), > [`docker/build-push-action`](https://github.com/docker/build-push-action), > [`bioconductor_docker`](https://github.com/Bioconductor/bioconductor_docker). -> For more details on how these projects relate to `rworkflows`, please -> see [below](#acknowledgments). -## Quickstart +## โฉ Quickstart Install and create the workflow in your R packageโ€™s project folder. -``` r -## in R +In R (only need to do once per repository): -#### Install rworkflows R package #### -### For the stable CRAN release +``` r +### 1. Install stable CRAN release if(!require("rworkflows")) install.packages("rworkflows") - -### Or, for the latest development version +### Or, install latest development version # if(!require("rworkflows")) remotes::install_github("neurogenomics/rworkflows") -### Create workflow file +### 2. Create workflow file path <- rworkflows::use_workflow() ``` -Push to GitHub, and let everything else run automatically! You can check -the status of your workflow by clicking on the *Actions* tab in your -GitHub repo. +Then, in the Terminal: ``` bash -## in the Terminal +### 3. Push to GitHub git add . -git commit -m "Added rworkflows" +git commit -m "Added rworkflows" # Arbitrary commit message git push ``` -**Note**: If you want to skip running **GitHub Actions** on a particular -push, simply add โ€œ\[skip ci\]โ€ somewhere in the commit message, e.g.: -`git commit -m "Update README [skip ci]"` - -## Documentation - -### [Vignettes](https://neurogenomics.github.io/rworkflows/articles/) +Now you can let everything run on GitHub automatically! You can check +the status of your workflow by clicking on the [*Actions* +tab](https://github.com/neurogenomics/rworkflows/actions) in your GitHub +repo. -#### [Get started](https://neurogenomics.github.io/rworkflows/articles/rworkflows.html) +### ๐Ÿคซ Special commit messages -Introductory vignette for using `rworkflows`. +Including special keywords in your commit message will have a certain +effect: +- `"[skip ci]"`: will skip running the workflow on this push. +- `"[nodocker]"`: will skip any Docker registry steps. +- `"[noncache]"`: will not use any cached installations or files. -#### [Docker/Singularity](https://neurogenomics.github.io/rworkflows/articles/docker) +For example: `git commit -m "Update README [skip ci]"` will skip running +any GitHub Actions. -Copy-and-paste instructions for creating a **Docker** or **Singularity** -container with the `rworkflows` R package pre-installed. - -#### [Dependency graph](https://neurogenomics.github.io/rworkflows/articles/depgraph). - -Interactive graph showing all the GitHub repos that currently use the -`rworkflows` action. - -### [Videos](https://www.youtube.com/@NeurogenomicsLab) - -#### [rworkflows: taming the Wild West of R packages](https://youtu.be/nLIG2prEmCg) - -Talk on the background, motivation, and utility of `rworkflows`. - -#### [Getting into the flow with rworkflows: an introductory tutorial](https://youtu.be/vcpMsil3EAU) - -Step-by-step tutorial showing how to use `rworkflows` in an R package. - -### GitHub Secrets +### ๐Ÿ” GitHub Secrets To use certain features of `rworkflows`, you may need to set up one or more [GitHub @@ -175,112 +167,106 @@ Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets): - `PAT_GITHUB` \[Optional\]: Can grant access to private repos on GitHub Actions. You can generate your very own Personal Authentication Token - with `usethis::create_github_token()`. See the [GitHub - docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) - for details. + with `usethis::create_github_token()`. [See + more](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). - `DOCKER_TOKEN` \[Optional\]: Allows GitHub Actions to push to a - [DockerHub](https://hub.docker.com) account. - -## Citation - -If you use `rworkflows`, please cite: - - - -> Brian M. Schilder, Alan E. Murphy, & Nathan G. Skene (2023) The -> rworkflows suite: automated continuous integration for quality -> checking, documentation website creation, and containerised deployment -> of R packages, *Research Square*; -> - -## Acknowledgments + [DockerHub](https://hub.docker.com) account. [See + more](https://docs.docker.com/security/for-developers/access-tokens/). +- `CODECOV_TOKEN` \[Optional\]: Bypasses issues that occasionally arise + from GitHub API limits. [See + more](https://docs.codecov.com/reference/overview). + +## ๐Ÿ“š Documentation + +### [๐Ÿง‘โ€๐ŸŽ“ Vignettes](https://neurogenomics.github.io/rworkflows/articles/) + +- [๐Ÿ“– **Get + started**](https://neurogenomics.github.io/rworkflows/articles/rworkflows.html): + Introductory vignette for using `rworkflows`. +- [๐Ÿณ + **Docker/Singularity**](https://neurogenomics.github.io/rworkflows/articles/docker): + Copy-and-paste instructions for creating a **Docker** or + **Singularity** container with the `rworkflows` R package + pre-installed. +- [๐Ÿ•ธ๏ธ **Dependency + graph**](https://neurogenomics.github.io/rworkflows/articles/depgraph): + Interactive graph showing all the GitHub repos that currently use the + `rworkflows` action. + +### [๐ŸŽฅ Videos](https://www.youtube.com/@NeurogenomicsLab) + +- [๐Ÿค  **rworkflows: taming the Wild West of R + packages**](https://youtu.be/nLIG2prEmCg): Talk on the background, + motivation, and utility of `rworkflows`. +- [๐ŸŒŠ **Getting into the flow with rworkflows: an introductory + tutorial**](https://youtu.be/vcpMsil3EAU): Step-by-step tutorial + showing how to use `rworkflows` in an R package. + +## ๐Ÿ™ Acknowledgments `rworkflows` builds upon the work of many others, especially the following: -### [`biocthis`](https://github.com/lcolladotor/biocthis) - -This workflow is largely inspired by the workflow generated by the -[`use_bioc_github_action()`](https://lcolladotor.github.io/biocthis/articles/biocthis.html) -function within the -[`biothis`](https://www.bioconductor.org/packages/release/bioc/html/biocthis.html) -package, developed by @lcolladotor. - -#### Key changes in `rworkflows` - -- Uses dynamic variables to specify R/Bioconductor versions - (e.g.ย `r: "latest"`) and the name of your R package, as opposed to - static names that are likely to become outdated (e.g.ย `r: "4.0.1"`). -- Additional error handling and dependencies checks. -- Re-renders `README.Rmd` before rebuilding the documentation website. - -### [`usethis`](https://github.com/r-lib/usethis) - -`biocthis` was in turn inspired by `usethis`. - -### [`actions/`](https://github.com/actions) - -A general set of **GitHub Actions** maintained by the core GitHub team. - -### [`r-lib/actions`](https://github.com/r-lib/actions) - -A set of **GitHub Actions** for R development maintained by the -Rstudio/Posit team. - -### [`bioc-actions`](https://github.com/grimbough/bioc-actions) - -[Bioconductor](https://www.bioconductor.org/)-oriented **GitHub -Actions** created by @grimbough. - -### [`JamesIves/github-pages-deploy-action`](https://github.com/JamesIves/github-pages-deploy-action) - -Builds and deploys the **GitHub Pages** documentation website in the -`rworkflows` GHA workflows. - -### [`docker/build-push-action`](https://github.com/docker/build-push-action) - -A set of **GitHub Actions** for building/pushing **Docker** containers. - -### [`bioconductor_docker`](https://github.com/Bioconductor/bioconductor_docker) - -Uses the official -[`bioconductor/bioconductor_docker`](https://github.com/Bioconductor/bioconductor_docker) -**Docker** container. - -**NOTE**: Whenever a new version of Bioconductor is released, the -`bioconductor/bioconductor_docker` container will often lag behind the -actual Bioconductor releases for up to several days, due to the time it -takes to update the container. This means that sometimes โ€œdevelโ€ in -`Bioconductor/bioconductor_docker` is actually referring to the current -โ€œreleaseโ€ version of Bioconductor (i.e.ย the previous Bioc versionโ€™s -โ€œdevelโ€). For further details, see this -[Issue](https://github.com/Bioconductor/bioconductor_docker/issues/37), -and the [Bioconductor release -schedule](https://www.bioconductor.org/about/release-announcements/). - -### [`scFlow`](https://github.com/combiz/scFlow) - -This Dockerfile was partly adapted from the [scFlow -Dockerfile](https://github.com/combiz/scFlow/blob/master/Dockerfile). -Unlike other Dockerfiles, this one **does not require any manual editing -when applying to different R packages**. This means that users who are -unfamiliar with **Docker** do not have to troubleshoot making this file -correctly. It also means that it will continue to work even if your R -package dependencies change. - -### [`act`](https://github.com/nektos/act) - -A very useful command line tool for testing **GitHub Actions** locally. - -### [`actions/runner-images`](https://github.com/actions/runner-images) - -Runner images for each OS provided by GitHub. - -### [`actions/setup-miniconda`](https://github.com/marketplace/actions/setup-miniconda) - -GitHub Action to setup Miniconda and conda environments. - -# Session Info +- [`biocthis`](https://github.com/lcolladotor/biocthis): This workflow + is largely inspired by the workflow generated by the + [`use_bioc_github_action()`](https://lcolladotor.github.io/biocthis/articles/biocthis.html) + function within the + [`biothis`](https://www.bioconductor.org/packages/release/bioc/html/biocthis.html) + package, developed by @lcolladotor. Key changes in `rworkflows` + - Uses dynamic variables to specify R/Bioconductor versions + (e.g.ย `r: "latest"`) and the name of your R package, as opposed to + static names that are likely to become outdated + (e.g.ย `r: "4.0.1"`). + - Additional error handling and dependencies checks. + - Re-renders `README.Rmd` before rebuilding the documentation + website. + - Conda support + - Ability to change registry +- [`usethis`](https://github.com/r-lib/usethis): `biocthis` was in turn + inspired by `usethis`. +- [`actions/`](https://github.com/actions): A general set of **GitHub + Actions** maintained by the core GitHub team. +- [`r-lib/actions`](https://github.com/r-lib/actions): A set of **GitHub + Actions** for R development maintained by the Rstudio/Posit team. +- [`bioc-actions`](https://github.com/grimbough/bioc-actions) + [Bioconductor](https://www.bioconductor.org/)-oriented **GitHub + Actions** created by @grimbough. +- [`JamesIves/github-pages-deploy-action`](https://github.com/JamesIves/github-pages-deploy-action): + Builds and deploys the **GitHub Pages** documentation website in the + `rworkflows` GHA workflows. +- [`docker/build-push-action`](https://github.com/docker/build-push-action): + A set of **GitHub Actions** for building/pushing **Docker** + containers. +- [`bioconductor_docker`](https://github.com/Bioconductor/bioconductor_docker): + Uses the official + [`bioconductor/bioconductor_docker`](https://github.com/Bioconductor/bioconductor_docker) + **Docker** container. + - **Note**: Whenever a new version of Bioconductor is released, the + `bioconductor/bioconductor_docker` container will often lag behind + the actual. Bioconductor releases for up to several days, due to the + time it takes to update the container. This means that sometimes + โ€œdevelโ€ in `Bioconductor/bioconductor_docker` is actually referring + to the current โ€œreleaseโ€ version of Bioconductor (i.e.ย the previous + Bioc versionโ€™s โ€œdevelโ€). For further details, see this + [Issue](https://github.com/Bioconductor/bioconductor_docker/issues/37), + and the [Bioconductor release + schedule](https://www.bioconductor.org/about/release-announcements/). +- [`scFlow`](https://github.com/combiz/scFlow): The `rworkflows` + Dockerfile template was partly adapted from the [scFlow + Dockerfile](https://github.com/combiz/scFlow/blob/master/Dockerfile). + Unlike other Dockerfiles, this one does not require any manual editing + when applying to different R packages. This means that users who are + unfamiliar with **Docker** do not have to troubleshoot making this + file correctly. It also means that it will continue to work even if + your R package dependencies change. +- [`act`](https://github.com/nektos/act): A very useful command line + tool for testing **GitHub Actions** locally. +- [`actions/runner-images`](https://github.com/actions/runner-images): + Runner images for each OS provided by GitHub. +- [`actions/setup-miniconda`](https://github.com/marketplace/actions/setup-miniconda): + GitHub Action to setup Miniconda and conda environments. + +## โ„น Session Info
@@ -311,16 +297,16 @@ utils::sessionInfo() ## [7] tidyselect_1.2.0 rvcheck_0.2.1 scales_1.2.1 ## [10] yaml_2.3.7 fastmap_1.1.1 here_1.0.1 ## [13] ggplot2_3.4.4 R6_2.5.1 generics_0.1.3 - ## [16] knitr_1.44 yulab.utils_0.1.0 tibble_3.2.1 - ## [19] desc_1.4.2 dlstats_0.1.7 rprojroot_2.0.3 + ## [16] knitr_1.45 yulab.utils_0.1.0 tibble_3.2.1 + ## [19] desc_1.4.2 dlstats_0.1.7 rprojroot_2.0.4 ## [22] munsell_0.5.0 pillar_1.9.0 RColorBrewer_1.1-3 - ## [25] rlang_1.1.1 utf8_1.2.4 cachem_1.0.8 - ## [28] badger_0.2.3 xfun_0.40 fs_1.6.3 + ## [25] rlang_1.1.2 utf8_1.2.4 cachem_1.0.8 + ## [28] badger_0.2.3 xfun_0.41 fs_1.6.3 ## [31] memoise_2.0.1.9000 cli_3.6.1 magrittr_2.0.3 - ## [34] rworkflows_1.0.0 digest_0.6.33 grid_4.3.1 - ## [37] rstudioapi_0.15.0 lifecycle_1.0.3 vctrs_0.6.4 - ## [40] data.table_1.14.8 evaluate_0.22 glue_1.6.2 + ## [34] rworkflows_1.0.2 digest_0.6.33 grid_4.3.1 + ## [37] rstudioapi_0.15.0 lifecycle_1.0.4 vctrs_0.6.4 + ## [40] data.table_1.14.8 evaluate_0.23 glue_1.6.2 ## [43] fansi_1.0.5 colorspace_2.1-0 rmarkdown_2.25 - ## [46] tools_4.3.1 pkgconfig_2.0.3 htmltools_0.5.6.1 + ## [46] tools_4.3.1 pkgconfig_2.0.3 htmltools_0.5.7
diff --git a/action.yml b/action.yml index c42aa100..ba2e1587 100644 --- a/action.yml +++ b/action.yml @@ -202,11 +202,8 @@ runs: mkdir -p /__w/_temp/Library echo ".libPaths('/__w/_temp/Library')" >> ~/.Rprofile git config --global --add safe.directory '*' - shell: bash {0} - - ## Most of these steps are the same as the ones in - ## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml - ## If they update their steps, we will also need to update ours. + shell: bash {0} + - name: โฌ Checkout repository uses: actions/checkout@v4 @@ -224,16 +221,23 @@ runs: uses: r-lib/actions/setup-pandoc@v2 with: pandoc-version: ${{ inputs.pandoc_version }} - + - name: โ” Query dependencies env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | - options(crayon.enabled = TRUE) - install.packages('remotes') - remotes::install_github("r-lib/remotes") + options(crayon.enabled = TRUE) + if(!require("remotes", quietly=TRUE)) install.packages('remotes') saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) shell: Rscript {0} + + - name: ๐Ÿ› ๐Ÿ”€ Install rworkflows R package + env: + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} + run: | + options(crayon.enabled = TRUE) + if(!require("rworkflows", quietly=TRUE)) remotes::install_github("neurogenomics/rworkflows", upgrade=TRUE) + shell: Rscript {0} - name: ๐Ÿฆ Restore R package cache if: | @@ -256,37 +260,15 @@ runs: - name: ๐Ÿ›  Install Linux system dependencies if: runner.os == 'Linux' run: | - 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 = " "))') - echo $sysreqs + sysreqs=$(Rscript -e 'rworkflows::dependencies_linux()') sudo -s eval "$sysreqs" - sudo apt-get install -y qpdf rsync shell: bash {0} - name: ๐Ÿ›  Install macOS system dependencies if: runner.os == 'macOS' run: | - #### --- Justifications for each package --- #### - ### libxml2 ### - # Enable installing XML from source if needed - ### imagemagick@6 ### - # Required to install magick as noted at - # https://github.com/r-lib/usethis/commit/f1f1e0d10c1ebc75fd4c18fa7e2de4551fd9978f#diff-9bfee71065492f63457918efcd912cf2 - ### harfbuzz fribidi ### - # For textshaping, required by ragg, and required by pkgdown - ### libgit2 ### - # For installing usethis's dependency gert - ### xquartz --cask ### - # Required for tcltk - ### libxfont ### - # Required for some ggplot2 functions - ### texlive ### - # Required for rendering Sweave files (even with r-lib/actions/setup-tinytex) - - #### --- Install packages --- #### - ### Install normally ### - brew install libxml2 imagemagick@6 harfbuzz fribidi libgit2 texlive - ### Install via cask ### - brew install xquartz --cask + sysreqs=$(Rscript -e 'rworkflows::dependencies_macos()') + sudo -s eval "$sysreqs" ### Set up xml2 ### echo "XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config" >> $GITHUB_ENV shell: bash {0} @@ -294,29 +276,24 @@ runs: - name: ๐Ÿ›  Install Windows system dependencies if: inputs.has_latex == 'true' && runner.os == 'Windows' run: | - #### npm #### npm install curl shell: pwsh {0} - - name: ๐Ÿ›  Install latex + - name: ๐Ÿ›  Install LaTeX if: inputs.has_latex == 'true' uses: r-lib/actions/setup-tinytex@v2 env: TINYTEX_INSTALLER: ${{ inputs.tinytex_installer }} TINYTEX_VERSION: ${{ inputs.tinytex_version }} - - name: ๐Ÿ›  Install latex packages + - name: ๐Ÿ›  Install LaTeX packages if: inputs.has_latex == 'true' env: tinytex_installer: ${{ inputs.tinytex_installer }} tinytex_version: ${{ inputs.tinytex_version }} run: | - install.packages("tinytex") - extra_packages <- c("bera","nowidow","parnotes","marginfix","etoolbox", - "titlesec","sectsty","framed","enumitem","parskip","soul","placeins", - "footmisc","changepage","xstring","caption","mathtools","fancyhdr", - "preprint","ragged2e","pdfcrop","titling","silence","everysel") - tinytex::tlmgr_install(pkgs = extra_packages) + if(!require("tinytex",quietly=TRUE)) install.packages("tinytex") + rworkflows::dependencies_latex() shell: Rscript {0} - name: ๐Ÿ›  Install dependencies pass 1 @@ -324,13 +301,10 @@ runs: timeout: ${{ inputs.timeout }} GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | - options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) - ## For running the checks - message(paste('****', Sys.time(), 'installing rcmdcheck ****')) - install.packages(c("rmarkdown","BiocManager"), dependencies = TRUE) + options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) message(paste('****', Sys.time(), 'pass number 1 at installing dependencies****')) repos <- BiocManager::repositories() - remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=TRUE) + remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=FALSE) continue-on-error: true shell: Rscript {0} @@ -342,29 +316,8 @@ runs: options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) message(paste('****', Sys.time(), 'pass number 2 at installing dependencies****')) repos <- BiocManager::repositories() - remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=TRUE) - shell: Rscript {0} - - - name: ๐Ÿ›  Install RUnit (via BiocGenerics) - if: inputs.has_runit == 'true' - run: | - options(crayon.enabled = TRUE) - BiocManager::install("BiocGenerics") - shell: Rscript {0} - - - name: ๐Ÿ›  Install covr - if: inputs.run_covr == 'true' && runner.os == 'Linux' - run: | - options(crayon.enabled = TRUE) - install.packages("covr") - shell: Rscript {0} - - - name: ๐Ÿ›  Install pkgdown - if: inputs.run_pkgdown == 'true' && runner.os == 'Linux' - run: | - options(crayon.enabled = TRUE) - install.packages("pkgdown") - shell: Rscript {0} + remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=FALSE) + shell: Rscript {0} - name: โ„น๏ธ Session info ๏ธ run: | @@ -388,7 +341,7 @@ runs: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) - if(!require("rcmdcheck", quietly=TRUE)) install.packages("rcmdcheck") + if(!require("rcmdcheck",quietly=TRUE)) install.packages("rcmdcheck") as_cran <- if(Sys.getenv("AS_CRAN")=='true') "--as-cran" else NULL run_build_vignettes <- if(Sys.getenv("run_vignettes")=='true') NULL else "--no-build-vignettes" run_vignettes <- if(Sys.getenv("run_vignettes")=='true') NULL else "--ignore-vignettes" @@ -412,6 +365,7 @@ runs: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) + if(!require("BiocGenerics",quietly=TRUE)) BiocManager::install("BiocGenerics") BiocGenerics:::testPackage() shell: Rscript {0} @@ -427,8 +381,7 @@ runs: run: | options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) #### Install deps #### - if(!require("BiocManager", quietly=TRUE)) install.packages("BiocManager") - if(!require("BiocCheck", quietly=TRUE)) BiocManager::install("BiocCheck") + if(!require("BiocCheck",quietly=TRUE)) BiocManager::install("BiocCheck") #### Allow for packages on CRAN #### no_check_vignettes <- Sys.getenv("run_vignettes")=='true' as_cran <- Sys.getenv("as_cran")=='true' @@ -447,6 +400,7 @@ runs: env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | + if(!require("covr",quietly=TRUE)) install.packages("covr") covr::codecov() shell: Rscript {0} @@ -455,36 +409,26 @@ runs: run: R CMD INSTALL . shell: bash {0} - - name: โ„น๏ธ Get R package info - if: runner.os == 'Linux' - run: | - #### DockerHub repos must be lowercase (,,) #### - name=$(grep '^Package:' DESCRIPTION | cut -d\ -f2) - echo "packageName=${name,,}" >> $GITHUB_ENV - echo "packageNameOrig=${name}" >> $GITHUB_ENV - echo $name - version=$(grep Version DESCRIPTION | grep -o "[0-9.]\+") - echo "packageVersion=${version}" >> $GITHUB_ENV - echo $version - echo "BASE_IMAGE=${{ matrix.config.cont }}" >> $GITHUB_ENV - shell: bash {0} - - name: ๐Ÿ“ฆ Render README if: inputs.run_pkgdown == 'true' && runner.os == 'Linux' env: DISPLAY: 99.0 + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | if(file.exists("README.Rmd")){ options(crayon.enabled = TRUE) - if(!require("rmarkdown", quietly=TRUE)) install.packages("rmarkdown"); + if(!require("rmarkdown",quietly=TRUE)) install.packages("rmarkdown"); rmarkdown::render("README.Rmd", output_format = rmarkdown::github_document(html_preview = FALSE)); } shell: Rscript {0} - name: ๐Ÿ“ฆ Build pkgdown site if: inputs.run_pkgdown == 'true' && runner.os == 'Linux' + env: + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | options(crayon.enabled = TRUE) + if(!require("pkgdown",quietly=TRUE)) install.packages("pkgdown") pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} @@ -504,16 +448,25 @@ runs: name: ${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-results path: check - ## DockerHub steps + ## DockerHub steps + - name: โ„น๏ธ Get R package info + if: runner.os == 'Linux' + run: | + #### DockerHub repos must be lowercase (,,) #### + name=$(grep '^Package:' DESCRIPTION | cut -d\ -f2) + echo "packageName=${name,,}" >> $GITHUB_ENV + echo "packageNameOrig=${name}" >> $GITHUB_ENV + version=$(grep Version DESCRIPTION | grep -o "[0-9.]\+") + echo "packageVersion=${version}" >> $GITHUB_ENV + shell: bash {0} + - name: ๐Ÿณโœ๏ธ Create Docker file if: | (!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux' env: - BASE_IMAGE: ${{ matrix.config.cont }} GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} + BASE_IMAGE: ${{ matrix.config.cont }} run: | - options(crayon.enabled = TRUE) - if(!require("rworkflows", quietly=TRUE)) remotes::install_github("neurogenomics/rworkflows") path <- rworkflows::use_dockerfile(base_image=Sys.getenv("BASE_IMAGE")) shell: Rscript {0} @@ -523,6 +476,7 @@ runs: uses: docker/build-push-action@v1 env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} + timeout: ${{ inputs.timeout }} with: username: ${{ github.repository_owner }} password: ${{ inputs.GITHUB_TOKEN }} @@ -534,8 +488,7 @@ runs: ${{ env.packageVersion }}, latest build_args: | - PKG=${{ env.packageNameOrig }}, - BASE_IMAGE=${{ matrix.config.cont }} + PKG=${{ env.packageNameOrig }} - name: ๐Ÿณ๐Ÿš€ Build and push to DockerHub if: | @@ -543,6 +496,7 @@ runs: uses: docker/build-push-action@v1 env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} + timeout: ${{ inputs.timeout }} with: username: ${{ inputs.docker_user }} password: ${{ inputs.DOCKER_TOKEN }} @@ -553,5 +507,4 @@ runs: ${{ env.packageVersion }}, latest build_args: | - PKG=${{ env.packageNameOrig }}, - BASE_IMAGE=${{ env.BASE_IMAGE }} + PKG=${{ env.packageNameOrig }} diff --git a/inst/example/check_rworkflows-merged.yml b/inst/example/check_rworkflows-merged.yml deleted file mode 100644 index 93713ff9..00000000 --- a/inst/example/check_rworkflows-merged.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: check_rworkflows-merged - -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -jobs: - check_rworkflows-merged: - permissinos: - contents: write - runs-on: ${{ matrix.config.os }} - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - container: ${{ matrix.config.cont }} - strategy: - fail-fast: false - matrix: - config: - - { os: ubuntu-latest, r: 'devel', bioc: 'devel', cont: "bioconductor/bioconductor_docker:devel"} - - { os: macOS-latest, r: 'latest', bioc: 'release'} - - { os: windows-latest, r: 'latest', bioc: 'release'} - steps: - - if: ${{ env.ACT }} - name: Hack container for local development - run: | - curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - - sudo apt-get install -y nodejs - - uses: actions/checkout@v3 - - uses: ./rworkflows-merged - with: - run_bioccheck: true - run_rcmdcheck: true - has_testthat: true - run_covr: true - run_pkgdown: true - has_runit: false - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run_docker: true - docker_user: 'bschilder' - docker_org: 'neurogenomicslab' - DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} - runner_os: ${{ runner.os }} - cache_version: 'cache-v1' - diff --git a/inst/example/rworkflows.yml b/inst/example/rworkflows.yml deleted file mode 100644 index f67374a5..00000000 --- a/inst/example/rworkflows.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: rworkflows - -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -jobs: - test-document-deploy: - permissions: - contents: write - runs-on: ${{ matrix.config.os }} - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - container: ${{ matrix.config.cont }} - strategy: - fail-fast: false - matrix: - config: - - { os: ubuntu-latest, r: 'devel', bioc: 'devel', cont: "bioconductor/bioconductor_docker:devel"} - - { os: macOS-latest, r: 'latest', bioc: 'release'} - - { os: windows-latest, r: 'latest', bioc: 'release'} - steps: - - uses: neurogenomics/rworkflows@master - with: - run_bioccheck: true - run_rcmdcheck: true - has_testthat: true - run_covr: true - run_pkgdown: true - has_runit: false - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run_docker: true - docker_user: 'bschilder' - docker_org: 'neurogenomicslab' - DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} - runner_os: ${{ runner.os }} - diff --git a/inst/templates/Dockerfile b/inst/templates/Dockerfile index 37ebd02f..c62b7729 100644 --- a/inst/templates/Dockerfile +++ b/inst/templates/Dockerfile @@ -1,53 +1,25 @@ -# ----- R Package Dockerfile ----- -# -# This Dockerfile is designed for developers of any R package stored on GitHub. -# -# It runs several steps: -# 1. Pulls the official bioconductor Docker container (which includes Rstudio). -# 2. Runs CRAN checks on the R package. -# 3. Installs the R package and all of its dependencies (including Depends, Imports, and Suggests). -# -# You can then create an image of the Docker container in any command line: -# docker pull / -# Once the image has been created, you can launch it with: -# docker run -d -e ROOT=true -e PASSWORD=bioc -v ~/Desktop:/Desktop -v /Volumes:/Volumes --rm -p 8788:8787 / -# Finally, launch the containerised Rstudio by entering the following URL in any web browser: -# http://localhost:8788/ -# -# The username will be "rstudio" by default, -# and you can set the password to whatever you like, -# -# This DockerFile was partly adapted from the [scFlow Dockerfile](https://github.com/combiz/scFlow/blob/master/Dockerfile). +# ----- rworkflows Dockerfile ----- +# For an example of how to use containers, see the following vignette: +# https://neurogenomics.github.io/rworkflows/articles/docker.html +# +#### --Step 1--: Specify the base image #### FROM {BASE_IMAGE} -RUN apt-get update && \ - apt-get install -y \ - git-core \ - libcurl4-openssl-dev \ - libgit2-dev \ - libicu-dev \ - libssl-dev \ - make pandoc \ - pandoc-citeproc \ - zlib1g-dev \ - xfonts-100dpi \ - xfonts-75dpi \ - biber \ - libsbml5-dev \ - qpdf \ - cmake \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* -# Create a buildzone folder named after the R package +#### --Step 2--: Create a buildzone folder #### # BiocCheck requires the buildzone to have the same name as the R package ARG PKG RUN echo $PKG RUN mkdir -p /$PKG ADD . /$PKG WORKDIR /$PKG -#### Install package dependencies #### -RUN Rscript -e 'options(download.file.method="libcurl", crayon.enabled=TRUE, timeout=2000); \ - if(!require("BiocManager")) install.packages("BiocManager"); \ - if(!require("remotes")) install.packages("remotes"); \ +#### --Step 3--: Install rworkflows #### +RUN Rscript -e 'if(!require("remotes")) install.packages("remotes"); \ + if(!require("rworkflows")) remotes::install_github("neurogenomics/rworkflows");' +#### --Step 4--: Install system dependencies #### +RUN sysreqs=$(Rscript -e 'rworkflows::dependencies_linux()') \ + sudo -s eval "$sysreqs" +#### --Step 5--:Install package dependencies #### +RUN Rscript -e 'options(download.file.method="libcurl", crayon.enabled=TRUE, timeout=Sys.getenv("timeout")); \ + if(!require("BiocManager")) install.packages("BiocManager"); \ repos <- BiocManager::repositories(); \ remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=TRUE);' RUN rm -rf /$PKG diff --git a/inst/templates/README.Rmd b/inst/templates/README.Rmd index 0fb6657d..08e97b49 100644 --- a/inst/templates/README.Rmd +++ b/inst/templates/README.Rmd @@ -11,7 +11,7 @@ output: ```{r, echo=FALSE, include=FALSE} pkg <- read.dcf("DESCRIPTION", fields = "Package")[1] title <- read.dcf("DESCRIPTION", fields = "Title")[1] -description <- read.dcf("DESCRIPTION", fields = "Description")[1] +description <- gsub("\n"," ",read.dcf("DESCRIPTION", fields = "Description")[1]) URL <- read.dcf('DESCRIPTION', fields = 'URL')[1] owner <- tolower(strsplit(URL,"/")[[1]][4]) ``` diff --git a/inst/templates/action_split.yml b/inst/templates/action_split.yml deleted file mode 100644 index 8dc965df..00000000 --- a/inst/templates/action_split.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: 'rworkflows' -description: > - rworkflows: Full workflow to test, document, and deploy R packages. -branding: - icon: check-square - color: green -author: 'Brian M. Schilder' -inputs: - GITHUB_TOKEN: - description: > - Token for the repo. Can be passed in using {{ secrets.GITHUB_TOKEN}} - run_bioccheck: - description: > - Run Bioconductor checks. Must pass in order to continue workflow. - type: boolean - default: false - run_rcmdcheck: - description: > - Run CRAN checks. Must pass in order to continue workflow." - type: boolean - default: true - has_testthat: - description: > - Run unit tests and report results. - type: boolean - default: true - run_covr: - description: > - Run code coverage tests and publish results to codecov. - type: boolean - default: true - run_pkgdown: - description: > - Knit the README.Rmd (if available), build documentation website, - and deploy to gh-pages branch. - type: boolean - default: true - has_runit: - description: > - Run R Unit tests. Requires a subdirectory named 'unitTests'. - type: boolean - default: false - cache_version: - description: > - Which cache version to use. - type: string - default: cache-v1 - run_docker: - description: > - Whether to build and push a Docker container to DockerHub. - type: boolean - default: true - docker_user: - description: > - DockerHub username. - type: string - docker_org: - description: > - DockerHub organization name. - type: string - DOCKER_TOKEN: - description: > - DockerHub token. - runner_os: - description: > - The Operating System (OS) that the workflow is running on. - type: string -runs: - using: 'composite' - steps: - - name: Install system dependencies - uses: neurogenomics/rworkflows/install-system@master - with: - i: inputs - - - name: Install R dependencies - uses: neurogenomics/rworkflows/install-r@master - with: - i: inputs - - - name: Check R package - uses: neurogenomics/rworkflows/check-r@master - with: - i: inputs - - - name: Build and deploy R package documentation website - uses: neurogenomics/rworkflows/build-site@master - with: - i: inputs - - - name: Build and deploy R package docker container - uses: neurogenomics/rworkflows/build-docker@master - with: - i: inputs diff --git a/inst/templates/docker.Rmd b/inst/templates/docker.Rmd index 41579c4b..8a0f50cf 100644 --- a/inst/templates/docker.Rmd +++ b/inst/templates/docker.Rmd @@ -3,7 +3,7 @@ title: "Docker/Singularity Containers" author: "

Authors: `r auths <- eval(parse(text = gsub('person','c',read.dcf('../DESCRIPTION', fields = 'Authors@R'))));paste(auths[names(auths)=='given'],auths[names(auths)=='family'], collapse = ', ')`

" date: "

Vignette updated: `r format( Sys.Date(), '%b-%d-%Y')`

" output: - BiocStyle::html_document: + rmarkdown::html_vignette: md_extensions: [ "-autolink_bare_uris" ] diff --git a/inst/templates/templateR.Rmd b/inst/templates/templateR.Rmd index a6866a28..aef9c333 100644 --- a/inst/templates/templateR.Rmd +++ b/inst/templates/templateR.Rmd @@ -3,7 +3,7 @@ title: "Get Started" author: "

Authors: `r auths <- eval(parse(text = gsub('person','c',read.dcf('../DESCRIPTION', fields = 'Authors@R'))));paste(auths[names(auths)=='given'],auths[names(auths)=='family'], collapse = ', ')`

" date: "

Vignette updated: `r format( Sys.Date(), '%b-%d-%Y')`

" output: - BiocStyle::html_document + rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{templateR} %\usepackage[utf8]{inputenc} diff --git a/man/dependencies_latex.Rd b/man/dependencies_latex.Rd new file mode 100644 index 00000000..7c681ae1 --- /dev/null +++ b/man/dependencies_latex.Rd @@ -0,0 +1,50 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dependencies_latex.R +\name{dependencies_latex} +\alias{dependencies_latex} +\title{Latex dependencies} +\usage{ +dependencies_latex( + extra = c("bera", "nowidow", "parnotes", "marginfix", "etoolbox", "titlesec", + "sectsty", "framed", "enumitem", "parskip", "soul", "placeins", "footmisc", + "changepage", "xstring", "caption", "mathtools", "fancyhdr", "preprint", "ragged2e", + "pdfcrop", "titling", "silence", "everysel"), + install = TRUE, + ... +) +} +\arguments{ +\item{extra}{Additional dependencies to install.} + +\item{install}{Install the packages with \link[tinytex]{tlmgr_install} +(\code{TRUE}). Otherwise, return a character vector of the packages to +install.} + +\item{...}{ + Arguments passed on to \code{\link[tinytex:tlmgr]{tinytex::tlmgr_install}} + \describe{ + \item{\code{usermode}}{(For expert users only) Whether to use TeX Live's +\href{https://www.tug.org/texlive/doc/tlmgr.html#USER-MODE}{user mode}. If +\code{TRUE}, you must have run \code{tlmgr('init-usertree')} once before. +This option allows you to manage a user-level texmf tree, e.g., install a +LaTeX package to your home directory instead of the system directory, to +which you do not have write permission. This option should not be needed on +personal computers, and has some limitations, so please read the +\pkg{tlmgr} manual very carefully before using it.} + \item{\code{pkgs}}{A character vector of LaTeX package names.} + \item{\code{path}}{Whether to run \code{tlmgr_path('add')} after installing packages +(\code{path = TRUE} is a conservative default: it is only necessary to do +this after a binary package is installed, such as the \pkg{metafont} +package, which contains the executable \command{mf}, but it does not hurt +even if no binary packages were installed).} + }} +} +\value{ +A character vector of extra latex packages. +} +\description{ +Install extra latex package dependencies. +} +\examples{ +dependencies_latex(install=FALSE) +} diff --git a/man/dependencies_linux.Rd b/man/dependencies_linux.Rd new file mode 100644 index 00000000..b4e29d63 --- /dev/null +++ b/man/dependencies_linux.Rd @@ -0,0 +1,56 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dependencies_linux.R +\name{dependencies_linux} +\alias{dependencies_linux} +\title{Linux dependencies} +\usage{ +dependencies_linux( + os = "ubuntu", + os_release = "20.04", + extra = c("qpdf", "rsync"), + prefix = paste("apt-get update -y", "apt-get install -y", sep = " && "), + verbose = TRUE, + ... +) +} +\arguments{ +\item{os, os_release}{The operating system and operating system release version, see +\url{https://github.com/rstudio/r-system-requirements#operating-systems} for the +list of supported operating systems. + +If \code{os_release} is \code{NULL}, \code{os} must consist of the operating system +and the version separated by a dash, e.g. \code{"ubuntu-18.04"}.} + +\item{extra}{Additional dependencies to install.} + +\item{prefix}{Prefix to prepend to the command.} + +\item{verbose}{Print messages.} + +\item{...}{ + Arguments passed on to \code{\link[remotes:system_requirements]{remotes::system_requirements}} + \describe{ + \item{\code{os,os_release}}{The operating system and operating system release version, see +\url{https://github.com/rstudio/r-system-requirements#operating-systems} for the +list of supported operating systems. + +If \code{os_release} is \code{NULL}, \code{os} must consist of the operating system +and the version separated by a dash, e.g. \code{"ubuntu-18.04"}.} + \item{\code{path}}{The path to the dev package's root directory.} + \item{\code{package}}{CRAN package name(s) to lookup system requirements for. If not +\code{NULL}, this is used and \code{path} is ignored.} + \item{\code{curl}}{The location of the curl binary on your system.} + }} +} +\value{ +Command to install system dependencies. +} +\description{ +Construct a command to install system dependencies for the +Linux OS environment. +Includes all dependencies listed by \link[remotes]{system_requirements}, +in addition to user-specified dependencies via \code{extra}. +} +\examples{ +dependencies_linux(package="rworkflows") +} diff --git a/man/dependencies_macos.Rd b/man/dependencies_macos.Rd new file mode 100644 index 00000000..bafc1033 --- /dev/null +++ b/man/dependencies_macos.Rd @@ -0,0 +1,51 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dependencies_macos.R +\name{dependencies_macos} +\alias{dependencies_macos} +\title{MacOS dependencies} +\usage{ +dependencies_macos( + extra = c("libxml2", "harfbuzz", "fribidi", "libgit2", "texlive", "imagemagick@6", + "rsync"), + cask = c("xquartz"), + prefix = "brew install", + verbose = TRUE +) +} +\arguments{ +\item{extra}{Additional dependencies to install.} + +\item{cask}{Additional dependencies to install via cask.} + +\item{prefix}{Prefix to prepend to the command.} + +\item{verbose}{Print messages.} +} +\value{ +Command to install system dependencies. +} +\description{ +Construct a command to install system dependencies for the +Mac OS environment. +} +\details{ +### --- Justifications for each package --- #### +## libxml2 ### +Enable installing XML from source if needed +## imagemagick@6 ### +Required to install magick as noted at +https://github.com/r-lib/usethis/commit/f1f1e0d10c1ebc75fd4c18fa7e2de4551fd9978f#diff-9bfee71065492f63457918efcd912cf2 +## harfbuzz fribidi ### +For textshaping, required by ragg, and required by pkgdown +## libgit2 ### +For installing usethis's dependency gert +## xquartz --cask ### +Required for tcltk +## libxfont ### +Required for some ggplot2 functions +## texlive ### +Required for rendering Sweave files (even with r-lib/actions/setup-tinytex) +} +\examples{ +dependencies_macos() +} diff --git a/man/dependencies_windows.Rd b/man/dependencies_windows.Rd new file mode 100644 index 00000000..74e1a1b5 --- /dev/null +++ b/man/dependencies_windows.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dependencies_windows.R +\name{dependencies_windows} +\alias{dependencies_windows} +\title{Windows dependencies} +\usage{ +dependencies_windows(extra = c("curl"), prefix = "npm install", verbose = TRUE) +} +\arguments{ +\item{extra}{Additional dependencies to install.} + +\item{prefix}{Prefix to prepend to the command.} + +\item{verbose}{Print messages.} +} +\value{ +Command to install system dependencies. +} +\description{ +Construct a command to install system dependencies for the +Windows environment. +} +\examples{ +dependencies_windows() +} diff --git a/tests/testthat/test-dependencies_latex.R b/tests/testthat/test-dependencies_latex.R new file mode 100644 index 00000000..90bd4881 --- /dev/null +++ b/tests/testthat/test-dependencies_latex.R @@ -0,0 +1,8 @@ +test_that("dependencies_latex works", { + + deps <- dependencies_latex(install=FALSE) + testthat::expect_gte(length(deps),20) + + # deps <- dependencies_latex(install=TRUE) + # testthat::expect_equal(deps,0) +}) diff --git a/tests/testthat/test-dependencies_linux.R b/tests/testthat/test-dependencies_linux.R new file mode 100644 index 00000000..699f180e --- /dev/null +++ b/tests/testthat/test-dependencies_linux.R @@ -0,0 +1,7 @@ +test_that("dependencies_linux works", { + + cmd <- utils::capture.output( + dependencies_linux(package="rworkflows") + ) + testthat::expect_true(grepl("^apt-get update",cmd)) +}) diff --git a/tests/testthat/test-dependencies_macos.R b/tests/testthat/test-dependencies_macos.R new file mode 100644 index 00000000..70fe2937 --- /dev/null +++ b/tests/testthat/test-dependencies_macos.R @@ -0,0 +1,7 @@ +test_that("dependencies_macos works", { + + cmd <- utils::capture.output( + dependencies_macos() + ) + testthat::expect_true(grepl("^brew install",cmd)) +}) diff --git a/tests/testthat/test-dependencies_windows.R b/tests/testthat/test-dependencies_windows.R new file mode 100644 index 00000000..d65decc7 --- /dev/null +++ b/tests/testthat/test-dependencies_windows.R @@ -0,0 +1,7 @@ +test_that("dependencies_windows works", { + + cmd <- utils::capture.output( + dependencies_windows() + ) + testthat::expect_true(grepl("^npm install",cmd)) +}) diff --git a/tests/testthat/test-use_dockerfile.R b/tests/testthat/test-use_dockerfile.R index bd2511f8..122ada03 100644 --- a/tests/testthat/test-use_dockerfile.R +++ b/tests/testthat/test-use_dockerfile.R @@ -9,5 +9,5 @@ test_that("use_dockerfile works", { show = TRUE) }) testthat::expect_true(file.exists(path2)) - testthat::expect_equal("# ----- R Package Dockerfile -----",out[[1]]) + testthat::expect_equal("# ----- rworkflows Dockerfile ----- ",out[[1]]) }) diff --git a/vignettes/bioconductor.Rmd b/vignettes/bioconductor.Rmd index b4134f72..abdfa3d6 100644 --- a/vignettes/bioconductor.Rmd +++ b/vignettes/bioconductor.Rmd @@ -3,7 +3,7 @@ title: "Bioconductor" author: "

Authors: `r auths <- eval(parse(text = gsub('person','c',read.dcf('../DESCRIPTION', fields = 'Authors@R'))));paste(auths[names(auths)=='given'],auths[names(auths)=='family'], collapse = ', ')`

" date: "

Vignette updated: `r format( Sys.Date(), '%b-%d-%Y')`

" output: - BiocStyle::html_document + rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Bioconductor} %\usepackage[utf8]{inputenc} diff --git a/vignettes/depgraph.Rmd b/vignettes/depgraph.Rmd index 68a36f41..157a466f 100644 --- a/vignettes/depgraph.Rmd +++ b/vignettes/depgraph.Rmd @@ -3,7 +3,7 @@ title: "Dependency graph" author: "

Authors: `r auths <- eval(parse(text = gsub('person','c',read.dcf('../DESCRIPTION', fields = 'Authors@R'))));paste(auths[names(auths)=='given'],auths[names(auths)=='family'], collapse = ', ')`

" date: "

Vignette updated: `r format( Sys.Date(), '%b-%d-%Y')`

" output: - BiocStyle::html_document + rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{depgraph} %\usepackage[utf8]{inputenc} diff --git a/vignettes/docker.Rmd b/vignettes/docker.Rmd index 218b5fc8..905a7ceb 100644 --- a/vignettes/docker.Rmd +++ b/vignettes/docker.Rmd @@ -5,7 +5,7 @@ author: '

Authors: `r auths <- eval(parse(text = gsub("person","c",read.dc collapse = ", ")`

' date: '

Vignette updated: `r format( Sys.Date(), "%b-%d-%Y")`

' output: - BiocStyle::html_document: + rmarkdown::html_vignette: md_extensions: -autolink_bare_uris params: cont: diff --git a/vignettes/rworkflows.Rmd b/vignettes/rworkflows.Rmd index 0945756b..bf2323a2 100644 --- a/vignettes/rworkflows.Rmd +++ b/vignettes/rworkflows.Rmd @@ -3,7 +3,7 @@ title: "Get Started" author: "

Authors: `r auths <- eval(parse(text = gsub('person','c',read.dcf('../DESCRIPTION', fields = 'Authors@R'))));paste(auths[names(auths)=='given'],auths[names(auths)=='family'], collapse = ', ')`

" date: "

Vignette updated: `r format( Sys.Date(), '%b-%d-%Y')`

" output: - BiocStyle::html_document + rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{rworkflows} %\usepackage[utf8]{inputenc}