Skip to content

Commit

Permalink
Move caching steps to be more effective. move action-tmate to end
Browse files Browse the repository at this point in the history
  • Loading branch information
bschilder committed Nov 17, 2023
1 parent 4ba980b commit 27863a2
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ runs:
with:
github_token: ${{ inputs.GITHUB_TOKEN }}
comment_on_pr: false

- name: πŸͺ² Setup interactive debugging
if: inputs.run_debug == 'true'
uses: mxschmitt/action-tmate@v3

- name: πŸ’Ύ Free Disk Space
if: inputs.free_diskspace == 'true' && runner.os == 'Linux'
Expand Down Expand Up @@ -218,6 +214,15 @@ runs:
- name: ⏬ Checkout repository
uses: actions/checkout@v4

- name: 🏦 Restore R package cache
if: |
!contains(github.event.head_commit.message, '[nocache]') && runner.os != 'Linux'
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ inputs.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ inputs.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-

## R/Bioc are already installed on the Bioc Docker container,
## and reinstalling them causes errors.
- name: πŸ›  Setup R and Bioconductor
Expand All @@ -241,25 +246,7 @@ runs:
if(!require("remotes", quietly=TRUE)) install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: 🏦 Restore R package cache
if: |
!contains(github.event.head_commit.message, '[nocache]') && runner.os != 'Linux'
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ inputs.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ inputs.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-

- name: 🏦 Cache R packages on Linux
if: |
!contains(github.event.head_commit.message, '[nocache]') && runner.os == 'Linux'
uses: actions/cache@v3
with:
path: /home/runner/work/_temp/Library
key: ${{ inputs.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ inputs.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-


- name: πŸ› πŸ”€ Install rworkflows R package
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
Expand Down Expand Up @@ -342,6 +329,15 @@ runs:
}, error = function(x){utils::sessionInfo()})
shell: Rscript {0}

- name: 🏦 Cache R packages on Linux
if: |
!contains(github.event.head_commit.message, '[nocache]') && runner.os == 'Linux'
uses: actions/cache@v3
with:
path: /home/runner/work/_temp/Library
key: ${{ inputs.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ inputs.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-

- name: βœ… Run CMD check
if: inputs.run_rcmdcheck == 'true'
env:
Expand Down Expand Up @@ -521,3 +517,7 @@ runs:
latest
build_args: |
PKG=${{ env.packageNameOrig }}
- name: πŸͺ² Setup interactive debugging
if: inputs.run_debug == 'true' && ${{ failure() }}
uses: mxschmitt/action-tmate@v3

0 comments on commit 27863a2

Please sign in to comment.