Skip to content

Commit d7b2c59

Browse files
committed
set a repository for install.packages in the rstan workflow
A bare 'Rscript' invocation has no repos option configured, so the dependency install failed with 'trying to use CRAN without setting a mirror' before rstan was ever built.
1 parent cdfafc6 commit d7b2c59

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/rstan.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,19 @@ jobs:
6666
# the packages that actually consume RcppParallel's flags. this is
6767
# rstan's Imports plus its LinkingTo, minus RcppParallel (installed above)
6868
# and StanHeaders (built from source below)
69+
# NOTE: a bare 'Rscript' has no repository configured -- setup-r arranges
70+
# that only for the steps it wraps -- so name one explicitly here and in
71+
# every install.packages() call below
6972
- name: install rstan's dependencies
7073
run: |
71-
Rscript -e 'install.packages(c("Rcpp","RcppEigen","BH","inline","gridExtra","loo","pkgbuild","QuickJSR","ggplot2"))'
74+
Rscript -e 'options(repos = c(CRAN = Sys.getenv("RSPM", unset = "https://cloud.r-project.org"))); install.packages(c("Rcpp","RcppEigen","BH","inline","gridExtra","loo","pkgbuild","QuickJSR","ggplot2"))'
7275
7376
# dependencies = FALSE so that resolving StanHeaders/rstan can't quietly
7477
# pull CRAN's RcppParallel over the one we just built -- that would turn
7578
# this into a test of the released package instead
7679
- name: install StanHeaders and rstan from source
7780
run: |
78-
Rscript -e 'install.packages(c("StanHeaders","rstan"), type = "source", dependencies = FALSE, INSTALL_opts = "--no-multiarch")'
81+
Rscript -e 'options(repos = c(CRAN = Sys.getenv("RSPM", unset = "https://cloud.r-project.org"))); install.packages(c("StanHeaders","rstan"), type = "source", dependencies = FALSE, INSTALL_opts = "--no-multiarch")'
7982
8083
# compare against this checkout's DESCRIPTION rather than looking for a
8184
# '.9000' suffix, so this keeps working across development version bumps

0 commit comments

Comments
 (0)