├── .github ├── .gitignore ├── CODE_OF_CONDUCT.md ├── SUPPORT.md └── workflows │ └── check-bioc.yml ├── vignettes ├── .gitignore └── BiocBinaryPackageTools.Rmd ├── NAMESPACE ├── .Rbuildignore ├── NEWS.md ├── .gitignore ├── DESCRIPTION ├── README.md └── R └── repository_stats.R /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^dev$ 2 | ^\.github$ 3 | ^.*\.Rproj$ 4 | ^\.Rproj\.user$ 5 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # BiocBinaryPackageTools 0.0.0.9000 2 | 3 | NEW FEATURES 4 | 5 | * Added a `NEWS.md` file to track changes to the package. 6 | 7 | SIGNIFICANT USER-VISIBLE CHANGES 8 | 9 | * Your main changes to a function `foo()` or parameter `param`. 10 | 11 | BUG FIXES 12 | 13 | * Your bug fixes. See more details at 14 | . 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # History files 2 | .Rhistory 3 | .Rapp.history 4 | *.Rproj 5 | 6 | ## Emacs backup files 7 | .\#* 8 | 9 | # Session Data files 10 | .RData 11 | 12 | # User-specific files 13 | .Ruserdata 14 | 15 | # Example code in package build process 16 | *-Ex.R 17 | 18 | # Output files from R CMD build 19 | /*.tar.gz 20 | 21 | # Output files from R CMD check 22 | /*.Rcheck/ 23 | 24 | # RStudio files 25 | .Rproj.user/ 26 | 27 | # produced vignettes 28 | vignettes/*.html 29 | vignettes/*.pdf 30 | 31 | # OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 32 | .httr-oauth 33 | 34 | # knitr and R markdown default cache directories 35 | *_cache/ 36 | /cache/ 37 | 38 | # Temporary files created by R markdown 39 | *.utf8.md 40 | *.knit.md 41 | 42 | # R Environment Variables 43 | .Renviron 44 | inst/doc 45 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: BiocBinaryPackageTools 2 | Title: Tools to query the Bioconductor package binary repositories. 3 | Version: 0.99.0 4 | Date: 2022-03-31 5 | Authors@R: 6 | person("Nitesh", "Turaga", , "nturaga.bioc@gmail.com", role = c("aut", "cre")) 7 | Description: The package allows users to query the Bioconductor binary package 8 | repositories for build status, build reports, failures, download 9 | statistics, and other important metrics. The Bioconductor binary 10 | packages are specifically for the 'bioconductor_docker' images and 11 | their successive inheriting images. The binaries are available free 12 | of cost to users, and speed up package installation by many orders of 13 | magnitude. 14 | License: Artistic-2.0 15 | URL: https://github.com/Bioconductor/BiocBinaryPackageTools 16 | BugReports: https://github.com/Bioconductor/BiocBinaryPackageTools/issues 17 | biocViews: Software 18 | Encoding: UTF-8 19 | Roxygen: list(markdown = TRUE) 20 | RoxygenNote: 7.1.2 21 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | The Bioconductor community values 2 | 3 | * an open approach to science that promotes the sharing of ideas, code, and expertise 4 | * collaboration 5 | * diversity and inclusivity 6 | * a kind and welcoming environment 7 | * community contributions 8 | 9 | In line with these values, Bioconductor is dedicated to providing a welcoming, supportive, collegial, experience free of harassment, intimidation, and bullying regardless of: 10 | 11 | * identity: gender, gender identity and expression, sexual orientation, disability, physical appearance, ethnicity, body size, race, age, religion, etc. 12 | * intellectual position: approaches to data analysis, software preferences, coding style, scientific perspective, etc. 13 | * stage of career 14 | 15 | In order to uphold these values, members of the Bioconductor community are required to follow the Code of Conduct.The latest version of Bioconductor project Code of Conduct is available at http://bioconductor.org/about/code-of-conduct/. Please read the Code of Conduct before contributing to this project. 16 | 17 | Thank you! 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BiocBinaryRepositoryPackageTools 2 | 3 | WIP package of ideas for querying available Bioconductor binary packages 4 | 5 | If package name needs to change, we'll change it. 6 | 7 | ## WISHLIST 8 | 9 | 1. AnVIL:::respository_stats() like function should work outside of containers with the right parameters. Stats without being on container 10 | 11 | BiocBinaryTools::binary_repo_stats(version = '3.15', container = c('bioconductor_docker', 'terra-jupyter')) 12 | 13 | 2. Build status / report 14 | 15 | BiocBinaryTools::binary_build_report(version, container) 16 | 17 | Returns: 18 | 19 | tibble with colnames Package, Status, error_url (or something like that.) 20 | 21 | 3. Package failure reason, Access reasons for failure 22 | 23 | 24 | BiocBinaryPkgTools::get_failed_pkg(package_name) 25 | 26 | 4. Download and read build report of package to see what caused the failure. 27 | 28 | get_failure_reason(package_name) 29 | 30 | 5. Download statistics 31 | 32 | Number of each package, total GB, 33 | 34 | 6. Should only work for Bioconductor admin - $cost 35 | 36 | 37 | 7. AnVIL versus non-AnVIL downloads? Google region? 38 | 39 | 8. Database to access failures and time for binary builds. 40 | -------------------------------------------------------------------------------- /R/repository_stats.R: -------------------------------------------------------------------------------- 1 | #' 2 | #' 3 | #' @export 4 | repository_stats <- 5 | function(version = character(), 6 | image = character()) 7 | { 8 | if (! nzchar(version)) { 9 | version <- BiocManager::version() 10 | message('Repository stats shown are for Bioconductor: ', version) 11 | } 12 | 13 | 14 | 15 | # version = '3.12' 16 | rel313 <- "https://storage.googleapis.com/bioconductor_docker/packages/3.13/bioc/src/contrib/PACKAGES" 17 | rel312 <- "https://storage.googleapis.com/bioconductor_docker/packages/3.12/bioc/src/contrib/PACKAGES" 18 | 19 | binary_base_url = gsub(pattern = 'src/contrib/PACKAGES', '', rel312) 20 | 21 | bioc_repository <- paste0("https://bioconductor.org/packages/", version, "/bioc") 22 | 23 | db_bioc <- available.packages(repos = bioc_repository) 24 | 25 | db_binary <- available.packages(repos = binary_base_url) 26 | binary_repository <- binary_base_url 27 | packages <- paste0(contrib.url(binary_repository), "/PACKAGES") 28 | 29 | missing_binaries <- setdiff(rownames(db_bioc), rownames(db_binary)) 30 | 31 | found_binaries <- intersect(rownames(db_bioc), rownames(db_binary)) 32 | bioc_versions <- package_version(db_bioc[found_binaries, "Version"]) 33 | binary_versions <- package_version(db_binary[found_binaries, 34 | "Version"]) 35 | binary_out_of_date <- bioc_versions > binary_versions 36 | n_out_of_date_binaries <- sum(binary_out_of_date) 37 | out_of_date_binaries <- found_binaries[binary_out_of_date] 38 | 39 | result <- list( 40 | bioconductor_version = version, bioconductor_binary_repository = if (length(binary_repository)) binary_repository else NA_character_, 41 | repository_exists = length(binary_repository) > 0L, n_software_packages = nrow(db_bioc), 42 | n_binary_packages = nrow(db_binary), n_binary_software_packages = length(found_binaries), 43 | n_missing_binaries = length(missing_binaries), out_of_date_binaries = out_of_date_binaries) 44 | 45 | result 46 | } 47 | -------------------------------------------------------------------------------- /.github/SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Getting help with `BiocBinaryPackageTools` 2 | 3 | Thanks for using `BiocBinaryPackageTools`! 4 | Before filing an issue, there are a few places to explore and pieces to put together to make the process as smooth as possible. 5 | 6 | ## Make a reprex 7 | 8 | Start by making a minimal **repr**oducible **ex**ample using the [reprex](https://reprex.tidyverse.org/) package. 9 | If you haven't heard of or used reprex before, you're in for a treat! 10 | Seriously, reprex will make all of your R-question-asking endeavors easier (which is a pretty insane ROI for the five to ten minutes it'll take you to learn what it's all about). 11 | For additional reprex pointers, check out the [Get help!](https://www.tidyverse.org/help/) section of the tidyverse site. 12 | 13 | ## Where to ask? 14 | 15 | Armed with your reprex, the next step is to figure out [where to ask](https://www.tidyverse.org/help/#where-to-ask). See also the [Bioconductor help](http://bioconductor.org/help/) website. 16 | 17 | * If it's a question: start with [community.rstudio.com](https://community.rstudio.com/), and/or StackOverflow. If this a Bioconductor-related question, please ask it at the [Bioconductor Support Website](https://support.bioconductor.org/) using the [appropriate package tag](https://support.bioconductor.org/t/BiocBinaryPackageTools) (the website will send an automatic email to the package authors). There are more people there to answer questions. 18 | 19 | * If it's a bug: you're in the right place, [file an issue](https://github.com/Bioconductor/BiocBinaryPackageTools/issues/new). 20 | 21 | * If you're not sure: let the community help you figure it out! 22 | If your problem _is_ a bug or a feature request, you can easily return here and report it. 23 | 24 | Before opening a new issue, be sure to [search issues and pull requests](https://github.com/Bioconductor/BiocBinaryPackageTools/issues) to make sure the bug hasn't been reported and/or already fixed in the development version. 25 | By default, the search will be pre-populated with `is:issue is:open`. 26 | You can [edit the qualifiers](https://help.github.com/articles/searching-issues-and-pull-requests/) (e.g. `is:pr`, `is:closed`) as needed. 27 | For example, you'd simply remove `is:open` to search _all_ issues in the repo, open or closed. 28 | 29 | ## What happens next? 30 | 31 | To be as efficient as possible, development of tidyverse packages tends to be very bursty, so you shouldn't worry if you don't get an immediate response. 32 | Typically we don't look at a repo until a sufficient quantity of issues accumulates, then there’s a burst of intense activity as we focus our efforts. 33 | That makes development more efficient because it avoids expensive context switching between problems, at the cost of taking longer to get back to you. 34 | This process makes a good reprex particularly important because it might be multiple months between your initial report and when we start working on it. 35 | If we can’t reproduce the bug, we can’t fix it! 36 | -------------------------------------------------------------------------------- /vignettes/BiocBinaryPackageTools.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "BiocBinaryPackageTools" 3 | author: 4 | - name: Your name 5 | affiliation: 6 | - Your institution 7 | email: your.email@somewhere.com 8 | output: 9 | BiocStyle::html_document: 10 | self_contained: yes 11 | toc: true 12 | toc_float: true 13 | toc_depth: 2 14 | code_folding: show 15 | date: "`r doc_date()`" 16 | package: "`r pkg_ver('BiocBinaryPackageTools')`" 17 | vignette: > 18 | %\VignetteIndexEntry{BiocBinaryPackageTools} 19 | %\VignetteEngine{knitr::rmarkdown} 20 | %\VignetteEncoding{UTF-8} 21 | --- 22 | 23 | ```{r setup, include = FALSE} 24 | knitr::opts_chunk$set( 25 | collapse = TRUE, 26 | comment = "#>", 27 | crop = NULL ## Related to https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016656.html 28 | ) 29 | ``` 30 | 31 | 32 | ```{r vignetteSetup, echo=FALSE, message=FALSE, warning = FALSE} 33 | ## Track time spent on making the vignette 34 | startTime <- Sys.time() 35 | 36 | ## Bib setup 37 | library("RefManageR") 38 | 39 | ## Write bibliography information 40 | bib <- c( 41 | R = citation(), 42 | BiocStyle = citation("BiocStyle")[1], 43 | knitr = citation("knitr")[1], 44 | RefManageR = citation("RefManageR")[1], 45 | rmarkdown = citation("rmarkdown")[1], 46 | sessioninfo = citation("sessioninfo")[1], 47 | testthat = citation("testthat")[1], 48 | BiocBinaryPackageTools = citation("BiocBinaryPackageTools")[1] 49 | ) 50 | ``` 51 | 52 | # Basics 53 | 54 | ## Install `BiocBinaryPackageTools` 55 | 56 | `R` is an open-source statistical environment which can be easily modified to enhance its functionality via packages. `r Biocpkg("BiocBinaryPackageTools")` is a `R` package available via the [Bioconductor](http://bioconductor.org) repository for packages. `R` can be installed on any operating system from [CRAN](https://cran.r-project.org/) after which you can install `r Biocpkg("BiocBinaryPackageTools")` by using the following commands in your `R` session: 57 | 58 | ```{r "install", eval = FALSE} 59 | if (!requireNamespace("BiocManager", quietly = TRUE)) { 60 | install.packages("BiocManager") 61 | } 62 | 63 | BiocManager::install("BiocBinaryPackageTools") 64 | 65 | ## Check that you have a valid Bioconductor installation 66 | BiocManager::valid() 67 | ``` 68 | 69 | ## Required knowledge 70 | 71 | `r Biocpkg("BiocBinaryPackageTools")` is based on many other packages and in particular in those that have implemented the infrastructure needed for dealing with RNA-seq data (EDIT!). That is, packages like `r Biocpkg("SummarizedExperiment")` (EDIT!). 72 | 73 | If you are asking yourself the question "Where do I start using Bioconductor?" you might be interested in [this blog post](http://lcolladotor.github.io/2014/10/16/startbioc/#.VkOKbq6rRuU). 74 | 75 | ## Asking for help 76 | 77 | As package developers, we try to explain clearly how to use our packages and in which order to use the functions. But `R` and `Bioconductor` have a steep learning curve so it is critical to learn where to ask for help. The blog post quoted above mentions some but we would like to highlight the [Bioconductor support site](https://support.bioconductor.org/) as the main resource for getting help: remember to use the `BiocBinaryPackageTools` tag and check [the older posts](https://support.bioconductor.org/t/BiocBinaryPackageTools/). Other alternatives are available such as creating GitHub issues and tweeting. However, please note that if you want to receive help you should adhere to the [posting guidelines](http://www.bioconductor.org/help/support/posting-guide/). It is particularly critical that you provide a small reproducible example and your session information so package developers can track down the source of the error. 78 | 79 | ## Citing `BiocBinaryPackageTools` 80 | 81 | We hope that `r Biocpkg("BiocBinaryPackageTools")` will be useful for your research. Please use the following information to cite the package and the overall approach. Thank you! 82 | 83 | ```{r "citation"} 84 | ## Citation info 85 | citation("BiocBinaryPackageTools") 86 | ``` 87 | 88 | # Quick start to using to `BiocBinaryPackageTools` 89 | 90 | ```{r "start", message=FALSE} 91 | library("BiocBinaryPackageTools") 92 | ``` 93 | 94 | Edit this as you see fit =) 95 | 96 | Here is an example of you can cite your package inside the vignette: 97 | 98 | * `r Biocpkg("BiocBinaryPackageTools")` `r Citep(bib[["BiocBinaryPackageTools"]])` 99 | 100 | 101 | 102 | # Reproducibility 103 | 104 | The `r Biocpkg("BiocBinaryPackageTools")` package `r Citep(bib[["BiocBinaryPackageTools"]])` was made possible thanks to: 105 | 106 | * R `r Citep(bib[["R"]])` 107 | * `r Biocpkg("BiocStyle")` `r Citep(bib[["BiocStyle"]])` 108 | * `r CRANpkg("knitr")` `r Citep(bib[["knitr"]])` 109 | * `r CRANpkg("RefManageR")` `r Citep(bib[["RefManageR"]])` 110 | * `r CRANpkg("rmarkdown")` `r Citep(bib[["rmarkdown"]])` 111 | * `r CRANpkg("sessioninfo")` `r Citep(bib[["sessioninfo"]])` 112 | * `r CRANpkg("testthat")` `r Citep(bib[["testthat"]])` 113 | 114 | This package was developed using `r BiocStyle::Biocpkg("biocthis")`. 115 | 116 | 117 | Code for creating the vignette 118 | 119 | ```{r createVignette, eval=FALSE} 120 | ## Create the vignette 121 | library("rmarkdown") 122 | system.time(render("BiocBinaryPackageTools.Rmd", "BiocStyle::html_document")) 123 | 124 | ## Extract the R code 125 | library("knitr") 126 | knit("BiocBinaryPackageTools.Rmd", tangle = TRUE) 127 | ``` 128 | 129 | Date the vignette was generated. 130 | 131 | ```{r reproduce1, echo=FALSE} 132 | ## Date the vignette was generated 133 | Sys.time() 134 | ``` 135 | 136 | Wallclock time spent generating the vignette. 137 | 138 | ```{r reproduce2, echo=FALSE} 139 | ## Processing time in seconds 140 | totalTime <- diff(c(startTime, Sys.time())) 141 | round(totalTime, digits = 3) 142 | ``` 143 | 144 | `R` session information. 145 | 146 | ```{r reproduce3, echo=FALSE} 147 | ## Session info 148 | library("sessioninfo") 149 | options(width = 120) 150 | session_info() 151 | ``` 152 | 153 | 154 | 155 | # Bibliography 156 | 157 | This vignette was generated using `r Biocpkg("BiocStyle")` `r Citep(bib[["BiocStyle"]])` 158 | with `r CRANpkg("knitr")` `r Citep(bib[["knitr"]])` and `r CRANpkg("rmarkdown")` `r Citep(bib[["rmarkdown"]])` running behind the scenes. 159 | 160 | Citations made with `r CRANpkg("RefManageR")` `r Citep(bib[["RefManageR"]])`. 161 | 162 | ```{r vignetteBiblio, results = "asis", echo = FALSE, warning = FALSE, message = FALSE} 163 | ## Print bibliography 164 | PrintBibliography(bib, .opts = list(hyperlink = "to.doc", style = "html")) 165 | ``` 166 | -------------------------------------------------------------------------------- /.github/workflows/check-bioc.yml: -------------------------------------------------------------------------------- 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: 'false' 38 | run_covr: 'false' 39 | run_pkgdown: 'false' 40 | has_RUnit: 'false' 41 | cache-version: 'cache-v1' 42 | run_docker: 'false' 43 | 44 | jobs: 45 | build-check: 46 | runs-on: ${{ matrix.config.os }} 47 | name: ${{ matrix.config.os }} (${{ matrix.config.r }}) 48 | container: ${{ matrix.config.cont }} 49 | ## Environment variables unique to this job. 50 | 51 | strategy: 52 | fail-fast: false 53 | matrix: 54 | config: 55 | - { os: ubuntu-latest, r: 'devel', bioc: '3.15', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" } 56 | - { os: macOS-latest, r: 'devel', bioc: '3.15'} 57 | - { os: windows-latest, r: 'devel', bioc: '3.15'} 58 | ## Check https://github.com/r-lib/actions/tree/master/examples 59 | ## for examples using the http-user-agent 60 | env: 61 | R_REMOTES_NO_ERRORS_FROM_WARNINGS: true 62 | RSPM: ${{ matrix.config.rspm }} 63 | NOT_CRAN: true 64 | TZ: UTC 65 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 66 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 67 | 68 | steps: 69 | 70 | ## Set the R library to the directory matching the 71 | ## R packages cache step further below when running on Docker (Linux). 72 | - name: Set R Library home on Linux 73 | if: runner.os == 'Linux' 74 | run: | 75 | mkdir /__w/_temp/Library 76 | echo ".libPaths('/__w/_temp/Library')" > ~/.Rprofile 77 | 78 | ## Most of these steps are the same as the ones in 79 | ## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml 80 | ## If they update their steps, we will also need to update ours. 81 | - name: Checkout Repository 82 | uses: actions/checkout@v2 83 | 84 | ## R is already included in the Bioconductor docker images 85 | - name: Setup R from r-lib 86 | if: runner.os != 'Linux' 87 | uses: r-lib/actions/setup-r@master 88 | with: 89 | r-version: ${{ matrix.config.r }} 90 | http-user-agent: ${{ matrix.config.http-user-agent }} 91 | 92 | ## pandoc is already included in the Bioconductor docker images 93 | - name: Setup pandoc from r-lib 94 | if: runner.os != 'Linux' 95 | uses: r-lib/actions/setup-pandoc@master 96 | 97 | - name: Query dependencies 98 | run: | 99 | install.packages('remotes') 100 | saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) 101 | shell: Rscript {0} 102 | 103 | - name: Restore R package cache 104 | if: "!contains(github.event.head_commit.message, '/nocache') && runner.os != 'Linux'" 105 | uses: actions/cache@v2 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@v2 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 | 126 | - name: Install macOS system dependencies 127 | if: matrix.config.os == 'macOS-latest' 128 | run: | 129 | ## Enable installing XML from source if needed 130 | brew install libxml2 131 | echo "XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config" >> $GITHUB_ENV 132 | 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 | 143 | ## Required for tcltk 144 | brew install xquartz --cask 145 | 146 | - name: Install Windows system dependencies 147 | if: runner.os == 'Windows' 148 | run: | 149 | ## Edit below if you have any Windows system dependencies 150 | shell: Rscript {0} 151 | 152 | - name: Install BiocManager 153 | run: | 154 | message(paste('****', Sys.time(), 'installing BiocManager ****')) 155 | remotes::install_cran("BiocManager") 156 | shell: Rscript {0} 157 | 158 | - name: Set BiocVersion 159 | run: | 160 | BiocManager::install(version = "${{ matrix.config.bioc }}", ask = FALSE, force = TRUE) 161 | shell: Rscript {0} 162 | 163 | - name: Install dependencies pass 1 164 | run: | 165 | ## Try installing the package dependencies in steps. First the local 166 | ## dependencies, then any remaining dependencies to avoid the 167 | ## issues described at 168 | ## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html 169 | ## https://github.com/r-lib/remotes/issues/296 170 | ## Ideally, all dependencies should get installed in the first pass. 171 | 172 | ## Set the repos source depending on the OS 173 | ## Alternatively use https://storage.googleapis.com/bioconductor_docker/packages/ 174 | ## though based on https://bit.ly/bioc2021-package-binaries 175 | ## the Azure link will be the main one going forward. 176 | gha_repos <- if( 177 | .Platform$OS.type == "unix" && Sys.info()["sysname"] != "Darwin" 178 | ) c( 179 | "AnVIL" = "https://bioconductordocker.blob.core.windows.net/packages/3.15/bioc", 180 | BiocManager::repositories() 181 | ) else BiocManager::repositories() 182 | 183 | ## For running the checks 184 | message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****')) 185 | install.packages(c("rcmdcheck", "BiocCheck"), repos = gha_repos) 186 | 187 | ## Pass #1 at installing dependencies 188 | ## This pass uses AnVIL-powered fast binaries 189 | ## details at https://github.com/nturaga/bioc2021-bioconductor-binaries 190 | ## The speed gains only apply to the docker builds. 191 | message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****')) 192 | remotes::install_local(dependencies = TRUE, repos = gha_repos, build_vignettes = FALSE, upgrade = TRUE) 193 | continue-on-error: true 194 | shell: Rscript {0} 195 | 196 | - name: Install dependencies pass 2 197 | run: | 198 | ## Pass #2 at installing dependencies 199 | ## This pass does not use AnVIL and will thus update any packages 200 | ## that have seen been updated in Bioconductor 201 | message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****')) 202 | remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE, force = TRUE) 203 | shell: Rscript {0} 204 | 205 | - name: Install BiocGenerics 206 | if: env.has_RUnit == 'true' 207 | run: | 208 | ## Install BiocGenerics 209 | BiocManager::install("BiocGenerics") 210 | shell: Rscript {0} 211 | 212 | - name: Install covr 213 | if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'Linux' 214 | run: | 215 | remotes::install_cran("covr") 216 | shell: Rscript {0} 217 | 218 | - name: Install pkgdown 219 | if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux' 220 | run: | 221 | remotes::install_github("r-lib/pkgdown") 222 | shell: Rscript {0} 223 | 224 | - name: Session info 225 | run: | 226 | options(width = 100) 227 | pkgs <- installed.packages()[, "Package"] 228 | sessioninfo::session_info(pkgs, include_base = TRUE) 229 | shell: Rscript {0} 230 | 231 | - name: Run CMD check 232 | env: 233 | _R_CHECK_CRAN_INCOMING_: false 234 | DISPLAY: 99.0 235 | run: | 236 | options(crayon.enabled = TRUE) 237 | rcmdcheck::rcmdcheck( 238 | args = c("--no-manual", "--no-vignettes", "--timings"), 239 | build_args = c("--no-manual", "--keep-empty-dirs", "--no-resave-data"), 240 | error_on = "warning", 241 | check_dir = "check" 242 | ) 243 | shell: Rscript {0} 244 | 245 | ## Might need an to add this to the if: && runner.os == 'Linux' 246 | - name: Reveal testthat details 247 | if: env.has_testthat == 'true' 248 | run: find . -name testthat.Rout -exec cat '{}' ';' 249 | 250 | - name: Run RUnit tests 251 | if: env.has_RUnit == 'true' 252 | run: | 253 | BiocGenerics:::testPackage() 254 | shell: Rscript {0} 255 | 256 | - name: Run BiocCheck 257 | env: 258 | DISPLAY: 99.0 259 | run: | 260 | BiocCheck::BiocCheck( 261 | dir('check', 'tar.gz$', full.names = TRUE), 262 | `quit-with-status` = TRUE, 263 | `no-check-R-ver` = TRUE, 264 | `no-check-bioc-help` = TRUE 265 | ) 266 | shell: Rscript {0} 267 | 268 | - name: Test coverage 269 | if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'Linux' 270 | run: | 271 | covr::codecov() 272 | shell: Rscript {0} 273 | 274 | - name: Install package 275 | if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux' 276 | run: R CMD INSTALL . 277 | 278 | - name: Build and deploy pkgdown site 279 | if: github.ref == 'refs/heads/master' && env.run_pkgdown == 'true' && runner.os == 'Linux' 280 | run: | 281 | git config --local user.name "$GITHUB_ACTOR" 282 | git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" 283 | Rscript -e "pkgdown::deploy_to_branch(new_process = FALSE)" 284 | shell: bash {0} 285 | ## Note that you need to run pkgdown::deploy_to_branch(new_process = FALSE) 286 | ## at least one locally before this will work. This creates the gh-pages 287 | ## branch (erasing anything you haven't version controlled!) and 288 | ## makes the git history recognizable by pkgdown. 289 | 290 | - name: Upload check results 291 | if: failure() 292 | uses: actions/upload-artifact@master 293 | with: 294 | name: ${{ runner.os }}-biocversion-devel-r-devel-results 295 | path: check 296 | 297 | - uses: docker/build-push-action@v1 298 | if: "!contains(github.event.head_commit.message, '/nodocker') && env.run_docker == 'true' && runner.os == 'Linux' " 299 | with: 300 | username: ${{ secrets.DOCKER_USERNAME }} 301 | password: ${{ secrets.DOCKER_PASSWORD }} 302 | repository: bioconductor/biocbinarypackagetools 303 | tag_with_ref: true 304 | tag_with_sha: true 305 | tags: latest 306 | --------------------------------------------------------------------------------