Skip to content

Commit

Permalink
Manually cache dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
saipavan10-git committed Dec 6, 2024
1 parent 175fc71 commit 3135ffa
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,31 @@ jobs:
steps:
- uses: actions/checkout@v2

# Set up and cache R dependencies
- name: Install and cache R dependencies
# Create directories for R libraries if not already present
- name: Create R Library Paths
run: |
mkdir -p /github/home/R/x86_64-pc-linux-gnu-library/4.4
mkdir -p renv/library
# Restore cache for R dependencies
- name: Restore R Dependencies Cache
uses: actions/cache@v4
with:
path: |
/github/home/R/x86_64-pc-linux-gnu-library/4.4
renv/library
key: ${{ runner.os }}-r-libs-${{ hashFiles('DESCRIPTION') }}
restore-keys: |
${{ runner.os }}-r-libs-
# Install R dependencies
- name: Install R Dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache: "always"
cache: false

- name: Debug Paths
# Verify library paths
- name: Debug R Library Paths
run: |
echo "Checking /github/home/R/x86_64-pc-linux-gnu-library/4.4"
ls -R /github/home/R/x86_64-pc-linux-gnu-library/4.4 || echo "Directory does not exist."
Expand All @@ -38,3 +56,12 @@ jobs:
- name: Run Tests
run: devtools::test(stop_on_failure = TRUE)
shell: Rscript {0}

# Save R dependencies to cache
- name: Save R Dependencies Cache
uses: actions/cache@v4
with:
path: |
/github/home/R/x86_64-pc-linux-gnu-library/4.4
renv/library
key: ${{ runner.os }}-r-libs-${{ hashFiles('DESCRIPTION') }}

0 comments on commit 3135ffa

Please sign in to comment.