Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the CI workflow for R CMD check. #275

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 18 additions & 67 deletions .github/workflows/check-bioc.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,28 @@
on: [push]
on:
push:
branches:
- master
pull_request:

name: R-CMD-check

jobs:
build-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
container: ${{ matrix.config.cont }}
## Environment variables unique to this job.

strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, r: '4.3', bioc: '3.18', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- { os: macOS-latest, r: '4.3', bioc: '3.18'}
## Check https://github.com/r-lib/actions/tree/master/examples
## for examples using the http-user-agent
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
NOT_CRAN: true
TZ: UTC
GITHUB_PAT: ${{ secrets.BEACHMAT_PAT }}
runs-on: ubuntu-latest
container: bioconductor/bioconductor_docker:devel

steps:
- name: Checkout Repository
uses: actions/checkout@v3

## For Macs - none of this is required for the Linux containers.
- name: Setup R from r-lib
if: runner.os != 'Linux'
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}

- name: Setup pandoc from r-lib
if: runner.os != 'Linux'
uses: r-lib/actions/setup-pandoc@v2

- name: Install BiocManager with the right version
if: runner.os != 'Linux'
run: |
install.packages("BiocManager")
BiocManager::install(version = "${{ matrix.config.bioc }}", ask = FALSE, force = TRUE)
shell: Rscript {0}

- name: Install remotes to get beachmat
if: runner.os != 'Linux'
run: |
BiocManager::install("remotes")
shell: Rscript {0}

- name: Install macOS system dependencies
if: matrix.config.os == 'macOS-latest'
run: |
## Enable installing XML from source if needed
brew install libxml2
echo "XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config" >> $GITHUB_ENV
uses: actions/checkout@v4

- name: Determine the package directory
run: R --no-echo -e "cat(paste0('R_PKG_DIR=', .libPaths()[1], '\n'))" >> $GITHUB_ENV

- name: Restore the package directory
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.R_PKG_DIR }}
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/dependencies.rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-
key: installed-packages

- name: Install R package dependencies
shell: Rscript {0}
Expand All @@ -77,24 +31,21 @@ jobs:
installs <- unlist(strsplit(deets[,c("Imports", "Depends", "Suggests", "LinkingTo")], ",\\s+"), use.names=FALSE)
BiocManager::install(installs)
BiocManager::install("BiocCheck")
saveRDS(file=".github/dependencies.rds", installs)

- name: Determine the Hub directories
run: R --no-echo -e "cat(paste0('EXPERIMENT_HUB_DIR=', suppressMessages(ExperimentHub::getExperimentHubOption('CACHE')), '\nANNOTATION_HUB_DIR=', suppressMessages(AnnotationHub::getAnnotationHubOption('CACHE')), '\n'))" >> $GITHUB_ENV
- name: Determine the data directories
run: R --no-echo -e "cat(paste0('GYPSUM_DIR=', suppressMessages(gypsum::cacheDirectory()), '\nANNOTATION_HUB_DIR=', suppressMessages(AnnotationHub::getAnnotationHubOption('CACHE')), '\n'))" >> $GITHUB_ENV

- name: Restore the ExperimentHub directory
uses: actions/cache@v3
- name: Restore the gypsum directory
uses: actions/cache@v4
with:
path: ${{ env.EXPERIMENT_HUB_DIR }}
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-ExperimentHub-${{ hashFiles('vignettes/*.Rmd') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-ExperimentHub-
path: ${{ env.GYPSUM_DIR }}
key: gypsum-cache

- name: Restore the AnnotationHub directory
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.ANNOTATION_HUB_DIR }}
key: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-AnnotationHub-${{ hashFiles('vignettes/*.Rmd') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocversion-RELEASE_${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-AnnotationHub-
key: AnnotationHub-cache

- name: Run CMD build
run: |
Expand Down
13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.