Skip to content

Update rev-dep-check.yaml #59

Update rev-dep-check.yaml

Update rev-dep-check.yaml #59

name: Reverse Dep Check
on:
pull_request:
branches: [ main ]
jobs:
gtsummary:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev
- name: Install and Cache Dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
# List the packages your script needs here
extra-packages: |
any::checked
any::rlang
any::cli
# This key ensures that if you change the list above,
# it creates a new cache rather than using an old one.
cache-version: 1
- name: Check Reverse Dependencies
shell: Rscript {0}
run: |
g <- checked::plan_rev_dep_checks(
path = ".",
repos = c('https://ddsjoberg.r-universe.dev', 'https://cloud.r-project.org')
)
vs <- igraph::V(g)
mt <- vs[checked:::is_meta(vs$task)]
nodes_to_skip <- mt[!xor(
endsWith(mt$name, "meta-revdep-gtsummary-of-cards"),
endsWith(mt$name, "meta-revdeps-of-cards")
)]
g <- igraph::delete_vertices(
g,
unlist(igraph::neighborhood(g, order = 1, nodes_to_skip, mode = "out"))
)
g <- checked:::task_graph_class(g)
design <- checked::checker$new(
g,
n = 20,
output = tempdir(),
lib.loc = .libPaths(),
restore = FALSE
)
checked::run(design, reporter = NULL)
(r <- checked::results(design))
# Logic to check for errors and abort if found
issues <- r[[1]][[1]]$errors$issues
if (!rlang::is_empty(issues)) {
cli::cli_abort(
c("This PR newly breaks {.pkg gtsummary}",
"!" = "The PR must be updated as to not break {.pkg gtsummary}.",
"i" = "In rare cases where the break is acceptable, the change {.emph MUST} first be approved by Daniel Sjoberg (danieldsjoberg@gmail.com) {.emph before} this PR could potentially be merged."
)
)
}