Skip to content

R-CMD-check

R-CMD-check #541

Workflow file for this run

name: R-CMD-check
on:
push:
pull_request:
branches:
- master
schedule:
- cron: '0 8 * * 5'
jobs:
R-CMD-check:
# define the operating systems and R versions we want to test on
strategy:
fail-fast: false
matrix:
config:
# - { os: macOS-latest, r: '4.1', bioc: '3.13'}
# - { os: windows-latest, r: '4.1', bioc: '3.13'}
# - { os: macOS-latest, r: 'devel', bioc: 'devel'}
- { os: macOS-latest, bioc: 'devel'}
# - { os: windows-latest, r: 'devel', bioc: 'devel'}
- { os: windows-latest, bioc: 'devel'}
# - { os: ubuntu-16.04, r: 'devel', bioc: 'devel', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- { os: ubuntu-latest, image: 'bioconductor/bioconductor_docker:devel'}
# - { os: macOS-latest, r: 'devel', image: 'bioconductor/bioconductor_docker:devel'}
runs-on: ${{ matrix.config.os }}
container: ${{ matrix.config.image }}
name: ${{ matrix.config.os }} (BioC ${{ matrix.config.bioc }} - ${{ matrix.config.image }})
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
PKG_PATH: monaLisa
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# CRAN: ${{ matrix.config.cran }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# steps to run in the defined environments
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
path: ${{ env.PKG_PATH }}
- name: Set up pandoc
uses: r-lib/actions/setup-pandoc@v2
if: matrix.config.image == null
- name: Set up R and install BiocManager
uses: grimbough/bioc-actions/setup-bioc@v1
if: matrix.config.image == null
with:
bioc-version: ${{ matrix.config.bioc }}
- name: Install Homer
if: runner.os != 'Windows' && matrix.config.image == null
run: |
mkdir homer && pushd homer
wget http://homer.ucsd.edu/homer/configureHomer.pl
perl configureHomer.pl -install
# export PATH=$PATH:$PWD/bin/
popd
# echo "^homer$" >> $PKG_PATH/.Rbuildignore
# Rscript -e 'install.packages("magick")'
- name: Install remotes
run: |
install.packages('remotes')
shell: Rscript {0}
- name: List package dependencies
run: |
saveRDS(remotes::dev_package_deps(pkgdir = "${{env.PKG_PATH}}", dependencies = TRUE, repos = c(getOption('repos'), BiocManager::repositories())), 'depends.Rds', version = 2)
shell: Rscript {0}
- name: Cache R packages
if: runner.os != 'Windows' && matrix.config.image == null
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-bioc-${{ matrix.config.bioc }}-${{ hashFiles('depends.Rds') }}
restore-keys: ${{ runner.os }}-bioc-${{ matrix.config.bioc }}-
- name: Install system dependencies for Linux
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
working-directory: '${{env.PKG_PATH}}'
pak-version: devel
- name: Install system dependencies for macOS
if: matrix.config.os == 'macOS-latest'
run: |
brew install harfbuzz
brew install fribidi
brew install --cask xquartz
- name: Install dependencies (R packages)
run: |
local_deps <- remotes::local_package_deps(pkgdir = "${{env.PKG_PATH}}", dependencies = TRUE)
deps <- remotes::dev_package_deps(pkgdir = "${{env.PKG_PATH}}", dependencies = TRUE, repos = BiocManager::repositories())
BiocManager::install(local_deps[local_deps %in% deps$package[deps$diff != 0]], Ncpu = 2L)
remotes::install_cran('rcmdcheck', Ncpu = 2L)
shell: Rscript {0}
- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- name: Check
run: |
Sys.getenv("GITHUB_WORKSPACE")
Sys.setenv(MONALISA_HOMER = file.path(Sys.getenv("GITHUB_WORKSPACE"), "homer/bin"))
Sys.getenv("MONALISA_HOMER")
rcmdcheck::rcmdcheck(path = "${{env.PKG_PATH}}",
args = c("--no-build-vignettes","--no-manual","--timings"),
error_on = "warning", check_dir = "check")
shell: Rscript {0}
- name: BiocCheck
run: |
BiocManager::install("BiocCheck")
BiocCheck::BiocCheck(package = "${{env.PKG_PATH}}")
shell: Rscript {0}
- name: Check NEWS.md
run: |
BiocManager::install(c("commonmark", "xml2"))
tools:::.build_news_db_from_package_NEWS_md("monaLisa/NEWS.md")
shell: Rscript {0}
- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Upload check results (if failed)
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-bioc-${{ matrix.config.bioc }}-results
path: check
- name: Test coverage
if: matrix.config.os == 'macOS-latest'
run: |
install.packages("covr")
covr::codecov(path = "${{env.PKG_PATH}}", token = "${{secrets.CODECOV_TOKEN}}")
shell: Rscript {0}
- name: Deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/devel' && matrix.config.os == 'macOS-latest'
working-directory: ${{env.PKG_PATH}}
run: |
R CMD INSTALL .
Rscript -e "remotes::install_dev('pkgdown'); pkgdown::deploy_to_branch(new_process = FALSE)"