using a private multiple source RSPM in github-actions for private R dependencies

Hey, I'm sorry if this isn't enough information, I'm happy to add more details if necessary.

We use Github Enterprise, and I'm using R >= 3.4

My ultimate goal is to have the R-CMD-CHECK github workflow pass a private R pkg (pkg A) that's dependent on a different private R package (pkg B) that's hosted on a private RSPM.

However, this RSPM has multiple associated repos (or sources): a private CRAN mirror and a private github mirror.

Two problems: I don't know how to specify a multiple-source RSPM as an env var in github actions, and both pkg A and pkg B are dependent on httr.

I've been trying to adapt the standard r-cmd-check.yml file to use our company's personal RSPM, but I'm unsure how, since I have to use both sources within this workflow file: the CRAN packages and the private git mirror that hosts pkg B. I can't use pak because as far as I know, it's still experimental, and I couldn't find documentation for installing purely from a URL and not a specific github repo, so I'm using remotes instead.

I've tried using this code in the "Install pak and query dependencies step":

- name: Install remotes and query dependencies
        run: |
          saveRDS(remotes::dev_package_deps(dependencies = TRUE, repos = c(<private CRAN mirror>,  <private github mirror for R pkgs>)), ".github/depends.Rds", version = 2)
          writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
        shell: Rscript {0}

This throws an error that it's unable to find pkg B, even though the repo is clearly listed. Pkg B is listed in "Imports" in the Description file as well.

Should I put in an extra step in order to set the RSPM for a specific installation of one package? And how would I set the variable since it's environmental?


I would suggest you set your companies RSPM as the rspm in the workflows.
You can do this by setting the RSPM environment variable, the default workflows automatically use this variable if set to set an RSPM instance.

  RSPM: my-companies-rspm-url

This topic was automatically closed after 45 days. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.