Skip to content

Batching

Batching #24

# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- revdep-workflow-testing
workflow_dispatch:
name: Reverse Dependency Checks
jobs:
revdep-checks:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
batch: [1]
name: Reverse dependency checks (batch ${{ matrix.batch }})
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rstanarm local::.
- name: Install R Package Build Dependencies
uses: r-hub/actions/setup-r-sysreqs@v1
with:
type: full
- name: Check reverse dependencies (batch ${{ matrix.batch }})
run: |
revdeps <- tools::package_dependencies("rstantools", reverse = TRUE, which = "all")$rstantools
revdeps <- split(revdeps, cut(seq_along(revdeps), 10, labels = FALSE))
curr_revdeps <- revdeps[[${{ matrix.batch }}]]
revdep_details <- available.packages()[available.packages()[,"Package"] %in% curr_revdeps,]
pkg_tar_names <- paste0(revdep_details[,"Package"], "_", revdep_details[,"Version"], ".tar.gz")
dir.create("./revdepchecks")
download.file(
url = paste0(revdep_details[,"Repository"], "/", pkg_tar_names),
destfile = file.path(getwd(), "revdepchecks", pkg_tar_names),
method = "libcurl",
mode = "wb"
)
pak::pak(revdep_details[,"Package"], dependencies = TRUE)
tools::check_packages_in_dir("./revdepchecks", Ncpus = 3)
shell: Rscript {0}