From ad6bc33ba9514eb8830816b5dee32842c3b37dbe Mon Sep 17 00:00:00 2001 From: Josh Taillon Date: Wed, 21 Oct 2026 19:28:23 -0600 Subject: [PATCH 1/2] ci: install R system requirements without the Chromium PPA pak installs Chromium on Ubuntu from ppa:xtradeb/apps, so every R job on Linux failed while Launchpad was unavailable, including the R CMD check jobs that never start a browser. Chromium is the only requirement that comes from outside Ubuntu's archive, and the runner image already ships Chrome. A shared composite action, r-sysreqs, asks pak for the same system requirements setup-r-dependencies would install, drops the chrome requirement, and installs the rest. setup-r-dependencies then runs with PKG_SYSREQS=false in the R CMD check, pkgdown, and citation browser workflows. The browser tests use the runner's Chrome, which chromote finds on the PATH. --- .github/actions/r-sysreqs/action.yml | 70 +++++++++++++++++++++++++ .github/workflows/R-CMD-check.yaml | 11 +++- .github/workflows/citation-browser.yaml | 12 ++++- .github/workflows/pkgdown.yaml | 12 ++++- 4 files changed, 99 insertions(+), 6 deletions(-) create mode 100644 .github/actions/r-sysreqs/action.yml diff --git a/.github/actions/r-sysreqs/action.yml b/.github/actions/r-sysreqs/action.yml new file mode 100644 index 000000000..204cebabd --- /dev/null +++ b/.github/actions/r-sysreqs/action.yml @@ -0,0 +1,70 @@ +name: Install R system requirements without the Chromium PPA +description: > + Installs the Linux system packages that setup-r-dependencies would install + for the same inputs, except Chromium. pak installs Chromium from a Launchpad + PPA, and that PPA's outages fail every Linux job; the runner image already + ships Chrome. Run setup-r-dependencies afterwards with PKG_SYSREQS set to + "false". Does nothing on macOS and Windows, where pak installs no system + packages. + +inputs: + extra-packages: + description: The extra-packages input given to setup-r-dependencies. + default: "" + needs: + description: The needs input given to setup-r-dependencies. + default: "" + working-directory: + description: The working-directory input given to setup-r-dependencies. + default: "." + +runs: + using: composite + steps: + - name: Install system requirements except Chromium + if: runner.os == 'Linux' + shell: Rscript {0} + working-directory: ${{ inputs.working-directory }} + env: + SYSREQS_EXTRA_PACKAGES: ${{ inputs.extra-packages }} + SYSREQS_NEEDS: ${{ inputs.needs }} + run: | + # A private library, so this pak does not interfere with the one + # setup-r-dependencies installs. + lib <- file.path(Sys.getenv("RUNNER_TEMP", tempdir()), "sysreqs-pak") + dir.create(lib, recursive = TRUE, showWarnings = FALSE) + install.packages("pak", lib = lib, quiet = TRUE, repos = sprintf( + "https://r-lib.github.io/p/pak/stable/%s/%s/%s", + .Platform$pkgType, R.Version()$os, R.Version()$arch + )) + # pak's worker subprocess looks for pak on the library path. + .libPaths(c(lib, .libPaths())) + + split <- function(x) { + parts <- trimws(strsplit(x, "[[:space:],]+")[[1]]) + parts[nzchar(parts)] + } + # The same resolution setup-r-dependencies asks pak for. + refs <- unique(c("deps::.", split(Sys.getenv("SYSREQS_EXTRA_PACKAGES")))) + needs <- split(Sys.getenv("SYSREQS_NEEDS")) + plan <- pak::pkg_sysreqs( + refs, + dependencies = c("all", if (length(needs)) paste0("Config/Needs/", needs)) + ) + rows <- plan$packages[plan$packages$sysreq != "chrome", ] + + sudo <- if (Sys.info()[["effective_user"]] == "root") "" else "sudo " + run <- function(command) { + message("> ", command) + status <- system(paste0( + sudo, "env DEBIAN_FRONTEND=noninteractive sh -c ", shQuote(command) + )) + if (status != 0) stop("Failed: ", command, call. = FALSE) + } + for (command in unique(unlist(rows$pre_install))) run(command) + run("apt-get -y update") + system_packages <- unique(unlist(rows$system_packages)) + if (length(system_packages)) { + run(paste("apt-get -y install", paste(system_packages, collapse = " "))) + } + for (command in unique(unlist(rows$post_install))) run(command) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 14c0e1813..0cb27637b 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -3,9 +3,9 @@ name: "R: R CMD check" on: push: branches: [main] - paths: [pkg-r/**, tests/shared/**, .github/workflows/R-CMD-check.yaml] + paths: [pkg-r/**, tests/shared/**, .github/workflows/R-CMD-check.yaml, .github/actions/r-sysreqs/**] pull_request: - paths: [pkg-r/**, tests/shared/**, .github/workflows/R-CMD-check.yaml] + paths: [pkg-r/**, tests/shared/**, .github/workflows/R-CMD-check.yaml, .github/actions/r-sysreqs/**] workflow_dispatch: permissions: read-all @@ -49,7 +49,14 @@ jobs: install.packages("odbc", lib = lib, repos = "https://cran.r-project.org") stopifnot(nzchar(system.file(package = "odbc", lib.loc = lib))) # END odbc workaround + - uses: ./.github/actions/r-sysreqs + with: + extra-packages: any::rcmdcheck, local::. + needs: check + working-directory: pkg-r - uses: r-lib/actions/setup-r-dependencies@v2 + env: + PKG_SYSREQS: "false" with: extra-packages: any::rcmdcheck, local::. needs: check diff --git a/.github/workflows/citation-browser.yaml b/.github/workflows/citation-browser.yaml index c47671671..85718ba62 100644 --- a/.github/workflows/citation-browser.yaml +++ b/.github/workflows/citation-browser.yaml @@ -3,9 +3,9 @@ name: "R: Citation browser tests" on: push: branches: [main] - paths: [pkg-r/**, tests/shared/**, .github/workflows/citation-browser.yaml] + paths: [pkg-r/**, tests/shared/**, .github/workflows/citation-browser.yaml, .github/actions/r-sysreqs/**] pull_request: - paths: [pkg-r/**, tests/shared/**, .github/workflows/citation-browser.yaml] + paths: [pkg-r/**, tests/shared/**, .github/workflows/citation-browser.yaml, .github/actions/r-sysreqs/**] workflow_dispatch: permissions: read-all @@ -23,11 +23,19 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true + - uses: ./.github/actions/r-sysreqs + with: + extra-packages: local::., any::devtools, any::shinytest2, any::chromote + needs: check + working-directory: pkg-r - uses: r-lib/actions/setup-r-dependencies@v2 + env: + PKG_SYSREQS: "false" with: extra-packages: local::., any::devtools, any::shinytest2, any::chromote needs: check working-directory: pkg-r + # The runner image's Chrome, since r-sysreqs skips the Chromium PPA. - name: Locate Chrome run: Rscript -e 'stopifnot(nzchar(chromote::find_chrome()))' - name: Run citation browser tests diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 251620701..48901648b 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -3,9 +3,9 @@ on: push: branches: [main, master] - paths: [pkg-r/**, tests/shared/**, docs/**, .github/workflows/pkgdown.yaml] + paths: [pkg-r/**, tests/shared/**, docs/**, .github/workflows/pkgdown.yaml, .github/actions/r-sysreqs/**] pull_request: - paths: [pkg-r/**, tests/shared/**, docs/**, .github/workflows/pkgdown.yaml] + paths: [pkg-r/**, tests/shared/**, docs/**, .github/workflows/pkgdown.yaml, .github/actions/r-sysreqs/**] release: types: [published] workflow_dispatch: @@ -36,7 +36,15 @@ jobs: - uses: r-lib/actions/setup-r@v2 + - uses: ./.github/actions/r-sysreqs + with: + extra-packages: any::pkgdown, local::. + needs: website + working-directory: pkg-r + - uses: r-lib/actions/setup-r-dependencies@v2 + env: + PKG_SYSREQS: "false" with: extra-packages: any::pkgdown, local::. needs: website From 81e97ce6d6938ec6d28c2040741f7e1e00ad41e0 Mon Sep 17 00:00:00 2001 From: Josh Taillon Date: Wed, 21 Oct 2026 19:36:21 -0600 Subject: [PATCH 2/2] Reword r-sysreqs action description about Chromium PPA outages --- .github/actions/r-sysreqs/action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/r-sysreqs/action.yml b/.github/actions/r-sysreqs/action.yml index 204cebabd..3fa4a07de 100644 --- a/.github/actions/r-sysreqs/action.yml +++ b/.github/actions/r-sysreqs/action.yml @@ -2,8 +2,9 @@ name: Install R system requirements without the Chromium PPA description: > Installs the Linux system packages that setup-r-dependencies would install for the same inputs, except Chromium. pak installs Chromium from a Launchpad - PPA, and that PPA's outages fail every Linux job; the runner image already - ships Chrome. Run setup-r-dependencies afterwards with PKG_SYSREQS set to + PPA. That PPA has seen multiple outages that cause Linux jobs to fail; + the runner image already ships Chrome, so we use that instead. + Run setup-r-dependencies afterwards with PKG_SYSREQS set to "false". Does nothing on macOS and Windows, where pak installs no system packages.