Skip to content

Commit befc1cd

Browse files
authored
Cache R dependencies in CI (#60)
* Use setup-r-dependencies to install R loo * Install R only on ubuntu * Fix dependencies action syntax * Only install required dependencies
1 parent e06e6ff commit befc1cd

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

.github/workflows/CI.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,24 @@ jobs:
3333
os: ubuntu-latest
3434
arch: x64
3535
downgrade: true
36+
37+
env:
38+
install_r: ${{ matrix.os == 'ubuntu-latest' }}
39+
3640
steps:
3741
- uses: actions/checkout@v4
3842
- uses: r-lib/actions/setup-r@v2
39-
if: matrix.os == 'ubuntu-latest'
43+
if: ${{ env.install_r }}
44+
- name: Install R loo
45+
uses: r-lib/actions/setup-r-dependencies@v2
46+
with:
47+
packages: |
48+
github::stan-dev/loo@v2.8.0
49+
dependencies: '"hard"'
50+
if: ${{ env.install_r }}
4051
- name: Set R lib path for RCall.jl
41-
if: matrix.os == 'ubuntu-latest'
4252
run: echo "LD_LIBRARY_PATH=$(R RHOME)/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
43-
- name: Install R packages
44-
if: matrix.os == 'ubuntu-latest'
45-
run: |
46-
install.packages("remotes")
47-
remotes::install_github("stan-dev/loo@v2.8.0")
48-
shell: Rscript {0}
49-
env:
50-
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
53+
if: ${{ env.install_r }}
5154
- uses: julia-actions/setup-julia@v2
5255
id: setup-julia
5356
with:
@@ -67,6 +70,7 @@ jobs:
6770
Pkg.add("Conda");
6871
Pkg.build("Conda");
6972
shell: julia --color=yes {0}
73+
if: ${{ env.install_r }}
7074
- uses: julia-actions/julia-runtest@v1
7175
- uses: julia-actions/julia-processcoverage@v1
7276
- uses: codecov/codecov-action@v5

0 commit comments

Comments
 (0)