Cache R package library on Travis CI

How to cache an R/Bioconductor package with multiple dependencies.
  1. Common steps
    1. Re-cache
    2. Clean up
  2. Examples
    1. basejump
    2. bcbioBase
    3. bcbioRNASeq
    4. bcbioSingleCell

R/Bioconductor packages with multiple dependencies can time out on Travis CI due to the 50 minute build timeout. Additionally, the semi-annual Bioconductor release update can nullify an existing package cache. When this occurs, here’s how you can quickly re-cache a package on GitHub.

Common steps

Re-cache

Clean up

Examples

Here’s how I re-cache my R packages on GitHub when necessary.

basejump

Replace DESCRIPTION with this:

Package: basejump
Title: TRAVIS BIOCONDUCTOR CACHE
Description: TRAVIS BIOCONDUCTOR CACHE
Version: 0.0.0.9000
Depends:
    R (>= 3.5)
Imports:
    SummarizedExperiment,
    SingleCellExperiment,
    ensembldb

bcbioBase

Package: bcbioBase
Title: TRAVIS BIOCONDUCTOR CACHE
Description: TRAVIS BIOCONDUCTOR CACHE
Version: 0.0.0.9000
Depends:
    R (>= 3.5)
Imports:
    SummarizedExperiment

bcbioRNASeq

Package: bcbioRNASeq
Title: TRAVIS BIOCONDUCTOR CACHE
Description: TRAVIS BIOCONDUCTOR CACHE
Version: 0.0.0.9000
Depends:
    R (>= 3.5)
Imports:
    SummarizedExperiment,
    DESeq2

bcbioSingleCell

Package: bcbioSingleCell
Title: TRAVIS BIOCONDUCTOR CACHE
Description: TRAVIS BIOCONDUCTOR CACHE
Version: 0.0.0.9000
Depends:
    R (>= 3.5)
Imports:
    SummarizedExperiment,
    SingleCellExperiment