From 085fab01e8ef0e379597f73690a2b37eadf1547a Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Fri, 10 Jul 2026 15:20:16 -0700 Subject: [PATCH 01/13] Added revdepcheck GHA --- .github/workflows/revdepcheck.yaml | 85 ++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/revdepcheck.yaml diff --git a/.github/workflows/revdepcheck.yaml b/.github/workflows/revdepcheck.yaml new file mode 100644 index 00000000..68d46b29 --- /dev/null +++ b/.github/workflows/revdepcheck.yaml @@ -0,0 +1,85 @@ +name: revdepcheck + +on: + workflow_dispatch: + inputs: + reset_revdeps: + description: "Delete revdep/ before running" + required: true + type: boolean + timeout_minutes: + description: "Timeout per reverse dependency" + required: false + default: 30 + type: numeric + +permissions: + contents: read + +concurrency: + group: revdepcheck-${{ github.ref }} + cancel-in-progress: false + +jobs: + revdepcheck: + runs-on: ubuntu-latest + timeout-minutes: 360 + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + NOT_CRAN: "true" + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::revdepcheck + needs: check + + - name: Reset revdep state + if: ${{ inputs.reset_revdeps }} + shell: Rscript {0} + run: | + revdepcheck::revdep_reset() + + - name: Run revdepcheck + shell: Rscript {0} + run: | + options(repos = c(CRAN = "https://cloud.r-project.org")) + revdepcheck::revdep_check( + num_workers = 2, + timeout = as.difftime( + as.integer("${{ inputs.timeout_minutes }}"), + units = "mins" + ), + env = c(revdepcheck::revdep_env_vars(), NOT_CRAN = TRUE) + ) + + - name: Show summary + shell: Rscript {0} + run: | + print(revdepcheck::revdep_summary()) + + - name: Upload revdep results + uses: actions/upload-artifact@v7 + with: + name: revdepcheck-results + path: revdep/ + retention-days: 14 + if-no-files-found: 'error' + + - name: Fail if revdeps broke + shell: Rscript {0} + run: | + status <- revdepcheck:::report_status(".") + message("Reverse dependencies OK: ", status$ok) + message("Reverse dependencies BROKEN: ", status$broken) + + if (status$broken > 0) { + stop(status$broken, " reverse dependency check(s) failed.") + } From f3f0848b6093d9c1f283b5a617438cebd8f876b4 Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Fri, 10 Jul 2026 15:21:20 -0700 Subject: [PATCH 02/13] Bumped checkout version --- .github/workflows/revdepcheck.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/revdepcheck.yaml b/.github/workflows/revdepcheck.yaml index 68d46b29..09886157 100644 --- a/.github/workflows/revdepcheck.yaml +++ b/.github/workflows/revdepcheck.yaml @@ -30,7 +30,7 @@ jobs: NOT_CRAN: "true" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: r-lib/actions/setup-r@v2 with: From 85256bb466658643ab71362d38991464502af0ed Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Fri, 10 Jul 2026 15:26:10 -0700 Subject: [PATCH 03/13] Fixed revdepcheck as extra pkg --- .github/workflows/revdepcheck.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/revdepcheck.yaml b/.github/workflows/revdepcheck.yaml index 09886157..c5b51cd6 100644 --- a/.github/workflows/revdepcheck.yaml +++ b/.github/workflows/revdepcheck.yaml @@ -38,7 +38,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::revdepcheck + extra-packages: r-lib/revdepcheck needs: check - name: Reset revdep state From a10a2e21cd957549a46892437540630f3b974f04 Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Fri, 10 Jul 2026 15:52:04 -0700 Subject: [PATCH 04/13] Use more workers and don't supress output --- .github/workflows/revdepcheck.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/revdepcheck.yaml b/.github/workflows/revdepcheck.yaml index c5b51cd6..2cfdf347 100644 --- a/.github/workflows/revdepcheck.yaml +++ b/.github/workflows/revdepcheck.yaml @@ -52,12 +52,13 @@ jobs: run: | options(repos = c(CRAN = "https://cloud.r-project.org")) revdepcheck::revdep_check( - num_workers = 2, + num_workers = 4, timeout = as.difftime( as.integer("${{ inputs.timeout_minutes }}"), units = "mins" ), - env = c(revdepcheck::revdep_env_vars(), NOT_CRAN = TRUE) + env = c(revdepcheck::revdep_env_vars(), NOT_CRAN = TRUE), + quiet = FALSE ) - name: Show summary From 96fe1816ac41b850d8237ef4198b44e6f46a7108 Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Sat, 11 Jul 2026 21:18:30 -0700 Subject: [PATCH 05/13] Added recursive revdepcheck GHA --- .github/revdepcheck/run.R | 13 ++++++ .github/run.sh | 15 ++++++ .github/workflows/revdepcheck.yaml | 75 ++++++++++++++---------------- 3 files changed, 64 insertions(+), 39 deletions(-) create mode 100644 .github/revdepcheck/run.R create mode 100644 .github/run.sh diff --git a/.github/revdepcheck/run.R b/.github/revdepcheck/run.R new file mode 100644 index 00000000..f4ec0e2f --- /dev/null +++ b/.github/revdepcheck/run.R @@ -0,0 +1,13 @@ +options(repos = c(CRAN = "https://cloud.r-project.org")) + +if (Sys.getenv("PREVIOUS_RUN_ID") == "") { + revdepcheck::revdep_reset() +} + +revdepcheck::revdep_check( + num_workers = 4, + timeout = as.difftime( + as.integer(Sys.getenv("TIMEOUT_MINUTES")), + units = "mins" + ) +) diff --git a/.github/run.sh b/.github/run.sh new file mode 100644 index 00000000..dc7d196b --- /dev/null +++ b/.github/run.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +set +e +timeout -s INT -k 5m 350m Rscript .github/revdepcheck/run.R +code=$? +set -e + +if [ "$code" = "124" ] || [ "$code" = "130" ] || [ "$code" = "137" ]; then + echo "again=true" >> "$GITHUB_OUTPUT" + exit 0 +fi + +echo "again=false" >> "$GITHUB_OUTPUT" +exit "$code" diff --git a/.github/workflows/revdepcheck.yaml b/.github/workflows/revdepcheck.yaml index 2cfdf347..3085c81e 100644 --- a/.github/workflows/revdepcheck.yaml +++ b/.github/workflows/revdepcheck.yaml @@ -3,18 +3,18 @@ name: revdepcheck on: workflow_dispatch: inputs: - reset_revdeps: - description: "Delete revdep/ before running" - required: true - type: boolean timeout_minutes: description: "Timeout per reverse dependency" required: false - default: 30 - type: numeric + default: "30" + previous_run_id: + description: "Previous run ID" + required: false + default: "" permissions: contents: read + actions: write concurrency: group: revdepcheck-${{ github.ref }} @@ -28,59 +28,56 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} NOT_CRAN: "true" + TIMEOUT_MINUTES: ${{ inputs.timeout_minutes }} + PREVIOUS_RUN_ID: ${{ inputs.previous_run_id }} steps: - uses: actions/checkout@v7 + - uses: actions/download-artifact@v8 + if: ${{ inputs.previous_run_id != '' }} + with: + name: revdep-state + path: revdep + run-id: ${{ inputs.previous_run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: r-lib/revdepcheck + extra-packages: any::revdepcheck needs: check - - name: Reset revdep state - if: ${{ inputs.reset_revdeps }} - shell: Rscript {0} - run: | - revdepcheck::revdep_reset() - - name: Run revdepcheck - shell: Rscript {0} - run: | - options(repos = c(CRAN = "https://cloud.r-project.org")) - revdepcheck::revdep_check( - num_workers = 4, - timeout = as.difftime( - as.integer("${{ inputs.timeout_minutes }}"), - units = "mins" - ), - env = c(revdepcheck::revdep_env_vars(), NOT_CRAN = TRUE), - quiet = FALSE - ) - - - name: Show summary - shell: Rscript {0} - run: | - print(revdepcheck::revdep_summary()) + id: revdep + run: bash .github/revdepcheck/run.sh - - name: Upload revdep results - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@v7 + if: always() with: - name: revdepcheck-results + name: revdep-state path: revdep/ retention-days: 14 - if-no-files-found: 'error' + if-no-files-found: ignore - - name: Fail if revdeps broke + - name: Continue + if: ${{ steps.revdep.outputs.again == 'true' }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh workflow run revdepcheck.yaml \ + --ref "${{ github.ref_name }}" \ + -f timeout_minutes="${{ inputs.timeout_minutes }}" \ + -f previous_run_id="${{ github.run_id }}" + + - name: Fail on broken revdeps + if: ${{ steps.revdep.outputs.again == 'false' }} shell: Rscript {0} run: | status <- revdepcheck:::report_status(".") - message("Reverse dependencies OK: ", status$ok) - message("Reverse dependencies BROKEN: ", status$broken) - if (status$broken > 0) { - stop(status$broken, " reverse dependency check(s) failed.") + stop(status$broken, " reverse dependencies have new failures.") } From a2bbf64d96f94a492bc6c18f065d3f0fcf82a3a8 Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Sat, 11 Jul 2026 21:23:34 -0700 Subject: [PATCH 06/13] Fixed revdep dep --- .github/workflows/revdepcheck.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/revdepcheck.yaml b/.github/workflows/revdepcheck.yaml index 3085c81e..ef7110ee 100644 --- a/.github/workflows/revdepcheck.yaml +++ b/.github/workflows/revdepcheck.yaml @@ -48,7 +48,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::revdepcheck + extra-packages: r-lib/revdepcheck needs: check - name: Run revdepcheck From 049d67450ad1bd3e88d9dbee0ee8e5d6d16ff2f3 Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Sat, 11 Jul 2026 21:27:18 -0700 Subject: [PATCH 07/13] Added run bash script --- .github/revdepcheck/run.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/revdepcheck/run.sh diff --git a/.github/revdepcheck/run.sh b/.github/revdepcheck/run.sh new file mode 100644 index 00000000..dc7d196b --- /dev/null +++ b/.github/revdepcheck/run.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +set +e +timeout -s INT -k 5m 350m Rscript .github/revdepcheck/run.R +code=$? +set -e + +if [ "$code" = "124" ] || [ "$code" = "130" ] || [ "$code" = "137" ]; then + echo "again=true" >> "$GITHUB_OUTPUT" + exit 0 +fi + +echo "again=false" >> "$GITHUB_OUTPUT" +exit "$code" From 97ce1aed68a23dbb1b7cc7b3e69428b7a0ceb2fe Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Sun, 12 Jul 2026 04:57:00 -0700 Subject: [PATCH 08/13] Fixed run code error --- .github/revdepcheck/run.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/revdepcheck/run.sh b/.github/revdepcheck/run.sh index dc7d196b..a8d44941 100644 --- a/.github/revdepcheck/run.sh +++ b/.github/revdepcheck/run.sh @@ -2,14 +2,21 @@ set -euo pipefail set +e -timeout -s INT -k 5m 350m Rscript .github/revdepcheck/run.R +timeout -s TERM -k 5m 350m Rscript .github/revdepcheck/run.R code=$? set -e -if [ "$code" = "124" ] || [ "$code" = "130" ] || [ "$code" = "137" ]; then - echo "again=true" >> "$GITHUB_OUTPUT" - exit 0 -fi - -echo "again=false" >> "$GITHUB_OUTPUT" -exit "$code" +case "$code" in + 124|130|137|143) + echo "again=true" >> "$GITHUB_OUTPUT" + exit 0 + ;; + 0) + echo "again=false" >> "$GITHUB_OUTPUT" + exit 0 + ;; + *) + echo "again=false" >> "$GITHUB_OUTPUT" + exit "$code" + ;; +esac From 729170dd14694ed6da887ee98f56dbf747233e84 Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Sun, 12 Jul 2026 14:17:29 -0700 Subject: [PATCH 09/13] Trying 3 workers --- .github/revdepcheck/run.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/revdepcheck/run.R b/.github/revdepcheck/run.R index f4ec0e2f..3afa2048 100644 --- a/.github/revdepcheck/run.R +++ b/.github/revdepcheck/run.R @@ -5,7 +5,7 @@ if (Sys.getenv("PREVIOUS_RUN_ID") == "") { } revdepcheck::revdep_check( - num_workers = 4, + num_workers = 3, timeout = as.difftime( as.integer(Sys.getenv("TIMEOUT_MINUTES")), units = "mins" From ac5a2659e73383d9756474b8a89110a15fda1573 Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Mon, 13 Jul 2026 13:08:08 -0700 Subject: [PATCH 10/13] Removed duplicate run script --- .github/run.sh | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 .github/run.sh diff --git a/.github/run.sh b/.github/run.sh deleted file mode 100644 index dc7d196b..00000000 --- a/.github/run.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -set +e -timeout -s INT -k 5m 350m Rscript .github/revdepcheck/run.R -code=$? -set -e - -if [ "$code" = "124" ] || [ "$code" = "130" ] || [ "$code" = "137" ]; then - echo "again=true" >> "$GITHUB_OUTPUT" - exit 0 -fi - -echo "again=false" >> "$GITHUB_OUTPUT" -exit "$code" From f56a45d4333118eb1ca2521882f29adf8d7cf58c Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Mon, 13 Jul 2026 13:44:49 -0700 Subject: [PATCH 11/13] Fixed GHA to have more deps --- .github/workflows/revdepcheck.yaml | 43 ++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/revdepcheck.yaml b/.github/workflows/revdepcheck.yaml index ef7110ee..4741cea1 100644 --- a/.github/workflows/revdepcheck.yaml +++ b/.github/workflows/revdepcheck.yaml @@ -6,7 +6,7 @@ on: timeout_minutes: description: "Timeout per reverse dependency" required: false - default: "30" + default: "60" previous_run_id: description: "Previous run ID" required: false @@ -48,7 +48,24 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: r-lib/revdepcheck + extra-packages: | + r-lib/revdepcheck + any::callr + any::rstantools + any::systemfonts + any::textshaping + any::ragg + any::Cairo + any::rjags + any::runjags + any::R2jags + any::gsl + any::Rmpfr + any::rJava + any::xlsx + any::xlsxjars + any::OpenCL + any::Rmpi needs: check - name: Run revdepcheck @@ -81,3 +98,25 @@ jobs: if (status$broken > 0) { stop(status$broken, " reverse dependencies have new failures.") } + + - name: Write final revdep report + if: ${{ always() && steps.revdep.outputs.again != 'true' }} + shell: Rscript {0} + run: | + try( + revdepcheck::revdep_report(pkg = ".", all = TRUE), + silent = TRUE + ) + + - name: Upload final revdep report + if: ${{ always() && steps.revdep.outputs.again != 'true' }} + uses: actions/upload-artifact@v7 + with: + name: revdep-report-${{ github.run_id }}-${{ github.run_attempt }} + path: | + revdep/README.md + revdep/problems.md + revdep/failures.md + revdep/cran.md + retention-days: 30 + if-no-files-found: warn From 4d7d462f4cdbd53989fbb1dbcfb393a0e051df33 Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Tue, 14 Jul 2026 13:41:29 -0700 Subject: [PATCH 12/13] Dropped to 2 workers --- .github/revdepcheck/run.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/revdepcheck/run.R b/.github/revdepcheck/run.R index 3afa2048..6d4a880d 100644 --- a/.github/revdepcheck/run.R +++ b/.github/revdepcheck/run.R @@ -5,7 +5,7 @@ if (Sys.getenv("PREVIOUS_RUN_ID") == "") { } revdepcheck::revdep_check( - num_workers = 3, + num_workers = 2, timeout = as.difftime( as.integer(Sys.getenv("TIMEOUT_MINUTES")), units = "mins" From f8b2c8efe226bf1320f25cee5260bbaaec45f26d Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Wed, 15 Jul 2026 14:50:55 -0700 Subject: [PATCH 13/13] Trying to fix lib paths? --- .github/revdepcheck/run.R | 6 ++++++ .github/workflows/revdepcheck.yaml | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/.github/revdepcheck/run.R b/.github/revdepcheck/run.R index 6d4a880d..c555a860 100644 --- a/.github/revdepcheck/run.R +++ b/.github/revdepcheck/run.R @@ -9,5 +9,11 @@ revdepcheck::revdep_check( timeout = as.difftime( as.integer(Sys.getenv("TIMEOUT_MINUTES")), units = "mins" + ), + quiet = FALSE, + env = c( + revdepcheck::revdep_env_vars(), + R_LIBS_SITE = normalizePath(.libPaths()[1], mustWork = TRUE) ) ) + diff --git a/.github/workflows/revdepcheck.yaml b/.github/workflows/revdepcheck.yaml index 4741cea1..06681054 100644 --- a/.github/workflows/revdepcheck.yaml +++ b/.github/workflows/revdepcheck.yaml @@ -45,6 +45,13 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true + extra-repositories: | + https://stan-dev.r-universe.dev + + - name: Install system libraries for hard revdeps + run: | + sudo apt-get update + sudo apt-get install -y libmagick++-dev libopenmpi-dev openmpi-bin - uses: r-lib/actions/setup-r-dependencies@v2 with: @@ -52,6 +59,7 @@ jobs: r-lib/revdepcheck any::callr any::rstantools + any::cmdstanr any::systemfonts any::textshaping any::ragg @@ -68,6 +76,17 @@ jobs: any::Rmpi needs: check + - name: cmdstan env vars + run: | + echo "CMDSTAN_PATH=${HOME}/.cmdstan" >> "$GITHUB_ENV" + shell: bash + + - name: Install cmdstan + run: | + cmdstanr::check_cmdstan_toolchain() + cmdstanr::install_cmdstan(cores = 2) + shell: Rscript {0} + - name: Run revdepcheck id: revdep run: bash .github/revdepcheck/run.sh