From 751dc706f7ffb703bbe00448981b0db1a4adfa4e Mon Sep 17 00:00:00 2001 From: Milan Malfait Date: Tue, 19 Oct 2021 13:15:12 +0200 Subject: [PATCH] Use `RENV_PATHS_ROOT` env variable to set renv cache path --- setup-renv/action.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/setup-renv/action.yaml b/setup-renv/action.yaml index f9f6396bb..1c5fead79 100644 --- a/setup-renv/action.yaml +++ b/setup-renv/action.yaml @@ -9,9 +9,15 @@ inputs: runs: using: "composite" steps: - - name: Install renv + - name: Set RENV_PATHS_ROOT + shell: bash + run: | + echo "RENV_PATHS_ROOT=${{ runner.temp }}/renv" >> $GITHUB_ENV + + - name: Install and activate renv run: | install.packages("renv") + renv::activate() shell: Rscript {0} - name: Get R and OS version @@ -24,7 +30,7 @@ runs: - name: Restore Renv package cache uses: actions/cache@v2 with: - path: $HOME/.local/share/renv + path: ${{ env.RENV_PATHS_ROOT }} key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-${{ hashFiles('renv.lock') }} restore-keys: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-