Skip to content

Commit

Permalink
Merge pull request #770 from milanmlft/setup-renv/working-directory
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi authored Oct 19, 2023
2 parents 4e3e721 + b1ac9f4 commit 650a554
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup-renv/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ inputs:
bypass-cache:
description: 'Whether attempts to cache should be completely skipped (for non GitHub testing). Set to `true` to skip.'
default: "false"
working-directory:
description: 'Using the working-directory keyword, you can specify a subdirectory of the repo where `renv` should be run.'
default: '.'
runs:
using: "composite"
steps:
Expand All @@ -24,6 +27,7 @@ runs:
if (!requireNamespace("renv", quietly=TRUE)) install.packages("renv")
renv::activate(profile = ${{ inputs.profile }})
shell: Rscript {0}
working-directory: ${{ inputs.working-directory }}

- name: Get R and OS version
id: get-version
Expand All @@ -37,12 +41,13 @@ runs:
uses: actions/cache@v3
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-${{ hashFiles('renv.lock') }}
key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-${{ hashFiles(format('{0}/renv.lock', inputs.working-directory)) }}
restore-keys: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-

- name: Install renv dependencies
run: renv::restore()
shell: Rscript {0}
working-directory: ${{ inputs.working-directory }}

- name: Don't use tar 1.30 from Rtools35 to store the cache
shell: bash
Expand Down

0 comments on commit 650a554

Please sign in to comment.