Skip to content

Commit

Permalink
now properly cache biocversion (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
zktuong authored Dec 6, 2024
1 parent 6e64612 commit 14d18a7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- "master"

env:
cache-version: "cache-v1"

jobs:
build:
strategy:
Expand All @@ -25,20 +28,33 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
- name: Setup R and Bioconductor
uses: grimbough/bioc-actions/setup-bioc@v1
id: install-r
with:
use-public-rspm: true
bioc-version: release

- name: Get R version
id: R
run: |
R --version > VERSION
echo "version=$(head -1 VERSION | awk '{print $3}')" >> $GITHUB_OUTPUT
shell: bash -l {0}

- name: Get Bioconductor version
id: BIOC
run: |
echo "version=$R_BIOC_VERSION" >> $GITHUB_OUTPUT
shell: bash -l {0}

- uses: r-lib/actions/setup-pandoc@v2

- name: Cache R packages
uses: actions/cache@v4
with:
path: /home/runner/work/_temp/Library
key: ${{ runner.OS }}-R-${{ steps.install-r.outputs.installed-r-version }}-cache-${{ hashFiles('.github/depends.Rds') }}
restore-keys: |
${{ runner.OS }}-R-${{ steps.install-r.outputs.installed-r-version }}-cache-
key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-${{ steps.BIOC.outputs.version}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-${{ steps.BIOC.outputs.version}}-r-${{ steps.R.outputs.version}}-

- name: Install and check
uses: r-lib/actions/setup-r-dependencies@v2
Expand Down
26 changes: 21 additions & 5 deletions .github/workflows/vignette.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:

name: vignette

env:
cache-version: "cache-v1"

jobs:
vignette:
defaults:
Expand All @@ -23,20 +26,33 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
- name: Setup R and Bioconductor
uses: grimbough/bioc-actions/setup-bioc@v1
id: install-r
with:
use-public-rspm: true
bioc-version: release

- name: Get R version
id: R
run: |
R --version > VERSION
echo "version=$(head -1 VERSION | awk '{print $3}')" >> $GITHUB_OUTPUT
shell: bash -l {0}

- name: Get Bioconductor version
id: BIOC
run: |
echo "version=$R_BIOC_VERSION" >> $GITHUB_OUTPUT
shell: bash -l {0}

- uses: r-lib/actions/setup-pandoc@v2

- name: Cache R packages
uses: actions/cache@v4
with:
path: /home/runner/work/_temp/Library
key: ${{ runner.OS }}-R-${{ steps.install-r.outputs.installed-r-version }}-cache-${{ hashFiles('.github/depends.Rds') }}
restore-keys: |
${{ runner.OS }}-R-${{ steps.install-r.outputs.installed-r-version }}-cache-
key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-${{ steps.BIOC.outputs.version}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-${{ steps.BIOC.outputs.version}}-r-${{ steps.R.outputs.version}}-

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand Down

0 comments on commit 14d18a7

Please sign in to comment.