Skip to content

Run R CMD check for strong dependencies only (nosuggests) #1

Run R CMD check for strong dependencies only (nosuggests)

Run R CMD check for strong dependencies only (nosuggests) #1

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.
name: Run R CMD check for strong dependencies only (nosuggests)
on: [pull_request, workflow_dispatch]
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
r-version: ["release"]
os: [ windows-latest ]
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"hard"'
cache: false
extra-packages: |
any::rcmdcheck
any::testthat
needs: check
- name: Identify and remove all non-critical packages
run: |
installed_packages <- data.table::data.table(utils::installed.packages())
required_packages <- c("power.transform", "rcmdcheck", "testthat")
required_packages <- union(required_packages, unlist(tools::package_dependencies(required_packages, recursive = TRUE), use.names=FALSE))
required_packages <- union(required_packages, installed_packages[Priority == "base"]$Package)
non_critical_packages <- setdiff(installed_packages$Package, required_packages)
for (package in non_critical_packages) {utils::remove.packages(installed_packages[Package == package]$Package, installed_packages[Package == package]$LibPath)}
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
args: 'c("--no-manual", "--as-cran", "--no-vignettes", "--no-build-vignettes")'
build_args: 'c("--no-build-vignettes", "--no-manual")'
error-on: '"error"'