Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cache mechanism for R packages #605

Open
zkamvar opened this issue Jun 4, 2021 · 0 comments
Open

Update cache mechanism for R packages #605

zkamvar opened this issue Jun 4, 2021 · 0 comments
Assignees

Comments

@zkamvar
Copy link
Contributor

zkamvar commented Jun 4, 2021

Our cache system is in the workflows is not working and that's because I did not have a good model of how the caching worked previously. Take the following code:

- name: Restore R Cache
if: steps.check-rmd.outputs.count != 0
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install needed packages
if: steps.check-rmd.outputs.count != 0
run: |
source('bin/dependencies.R')
install_required_packages()
shell: Rscript {0}
- name: Query dependencies
if: steps.check-rmd.outputs.count != 0
run: |
source('bin/dependencies.R')
deps <- identify_dependencies()
create_description(deps)
use_bioc_repos()
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

Line 60 depends on the files created by Lines 77 and 78, respectively. What needs to happen is that, of these three steps, "Restore R Cache" should go at the end. I wrote a bit about this the last time I had to wrestle this issue: carpentries/actions#13 (comment)

@zkamvar zkamvar self-assigned this Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant