@@ -47,54 +47,47 @@ jobs:
47
47
build-and-test-r :
48
48
49
49
runs-on : ${{ matrix.config.os }}
50
+ name : R ${{ matrix.config.os }} (${{ matrix.config.r }})
50
51
strategy :
51
52
matrix :
52
53
config :
53
- - {os: ubuntu-22.04, r: 'release', rspm: "https://packagemanager.example.com/our-cran/__linux__/jammy/latest" }
54
+ - {os: ubuntu-22.04, r: 'release'}
54
55
fail-fast : false
55
56
56
57
env :
58
+ GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
59
+ R_KEEP_PKG_SOURCE : yes
57
60
R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
58
- RSPM : ${{ matrix.config.rspm }}
61
+ PKGDIR : " R/ "
59
62
60
63
steps :
61
- - uses : actions/checkout@v4
62
- - uses : r-lib/actions/setup-pandoc@v2
63
- - name : Set up R
64
- uses : r-lib/actions/setup-r@v2
65
- with :
66
- r-version : ${{ matrix.config.r }}
67
- - name : Install remotes
68
- run : |
69
- install.packages('remotes')
70
- shell : Rscript {0}
71
- - name : Query dependencies
72
- run : |
73
- saveRDS(remotes::dev_package_deps(pkgdir = "R/", dependencies = TRUE), ".github/depends.Rds", version = 2)
74
- writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
75
- shell : Rscript {0}
76
- - name : Restore R package cache
77
- if : runner.os != 'Windows'
78
- uses : actions/cache@v4
79
- with :
80
- path : ${{ env.R_LIBS_USER }}
81
- key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
82
- restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
83
- - name : Install system dependencies
84
- if : runner.os == 'Linux'
85
- run : |
86
- while read -r cmd
87
- do
88
- eval sudo $cmd
89
- done < <(Rscript -e 'writeLines(remotes::system_requirements(os = "ubuntu", os_release = "22.04", path = "R/"))')
90
- - name : Install dependencies
91
- run : |
92
- remotes::install_deps(pkgdir = "R/", dependencies = NA)
93
- remotes::install_cran(c("rcmdcheck", "knitr", "testthat", "readr", "rmarkdown"))
94
- install.packages(c("cmdstanr", "posterior"), repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
95
- shell : Rscript {0}
96
- - name : Check
97
- uses : r-lib/actions/check-r-package@v2
98
- with :
99
- working-directory : " R/"
100
- upload-snapshots : true
64
+ - uses : actions/checkout@v4
65
+
66
+ - uses : r-lib/actions/setup-pandoc@v2
67
+
68
+ - uses : r-lib/actions/setup-r@v2
69
+ with :
70
+ r-version : ${{ matrix.config.r }}
71
+ use-public-rspm : true
72
+
73
+ # Install dependencies - separating the steps to fix dependency conflicts
74
+ - name : Install dependencies
75
+ run : |
76
+ install.packages('remotes')
77
+ remotes::install_deps(dependencies = TRUE)
78
+ remotes::install_cran(c("rcmdcheck", "knitr", "testthat", "readr", "rmarkdown"))
79
+ shell : Rscript {0}
80
+ working-directory : ${{ env.PKGDIR }}
81
+
82
+ # Install Stan packages separately if needed
83
+ - name : Install Stan packages
84
+ run : |
85
+ install.packages(c("cmdstanr", "posterior"), repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
86
+ shell : Rscript {0}
87
+
88
+ - name : Check
89
+ uses : r-lib/actions/check-r-package@v2
90
+ with :
91
+ upload-snapshots : true
92
+ build_args : ' c("--no-manual","--compact-vignettes=gs+qpdf")'
93
+ working-directory : ${{ env.PKGDIR }}
0 commit comments