From f4f96efbf976a45d4b486144d368f817992dbaa2 Mon Sep 17 00:00:00 2001
From: HDash <16350928+HDash@users.noreply.github.com>
Date: Tue, 5 Nov 2024 14:44:37 +0000
Subject: [PATCH 1/8] Add `force_install` input to bypass caching
---
.../workflows/rworkflows_force_install.yml | 57 +++++++++++++++++++
action.yml | 11 +++-
2 files changed, 66 insertions(+), 2 deletions(-)
create mode 100644 .github/workflows/rworkflows_force_install.yml
diff --git a/.github/workflows/rworkflows_force_install.yml b/.github/workflows/rworkflows_force_install.yml
new file mode 100644
index 00000000..0fcc461d
--- /dev/null
+++ b/.github/workflows/rworkflows_force_install.yml
@@ -0,0 +1,57 @@
+name: rworkflows
+'on':
+ push:
+ branches:
+ - master
+ - main
+ - devel
+ - RELEASE_**
+ pull_request:
+ branches:
+ - master
+ - main
+ - devel
+ - RELEASE_**
+jobs:
+ rworkflows:
+ permissions: write-all
+ runs-on: ${{ matrix.config.os }}
+ name: ${{ matrix.config.os }} (${{ matrix.config.r }})
+ container: ${{ matrix.config.cont }}
+ strategy:
+ fail-fast: ${{ false }}
+ matrix:
+ config:
+ - os: ubuntu-latest
+ r: auto
+ bioc: release
+ cont: ghcr.io/bioconductor/bioconductor_docker:RELEASE_3_19
+ python-version: 3.11
+ - os: macOS-latest
+ r: latest
+ bioc: release
+ python-version: 3.11
+ - os: windows-latest
+ r: latest
+ bioc: release
+ python-version: 3.11
+ steps:
+ - uses: neurogenomics/rworkflows@master
+ with:
+ run_bioccheck: ${{ false }}
+ run_rcmdcheck: ${{ true }}
+ as_cran: ${{ true }}
+ run_vignettes: ${{ true }}
+ has_testthat: ${{ true }}
+ run_covr: ${{ false }}
+ run_pkgdown: ${{ false }}
+ has_runit: ${{ false }}
+ # has_latex: ${{ true }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run_docker: ${{ false }}
+ DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
+ runner_os: ${{ runner.os }}
+ cache_version: cache-v1
+ force_install: ${{ true }}
+ # free_diskspace: ${{ true }}
+ # miniforge_variant: false
diff --git a/action.yml b/action.yml
index aca14b7a..5aa3bfdf 100644
--- a/action.yml
+++ b/action.yml
@@ -169,6 +169,13 @@ inputs:
Whether to run the workflow telemetry action:
https://github.com/catchpoint/workflow-telemetry-action
default: true
+ force_install:
+ description: >
+ Whether to force install packages. If `true`, all packages will be
+ reinstalled, bypassing the cache.
+ Recommended to set to `true` when pushing changes without updating R
+ package version, such as during pre-release phase of developement.
+ default: false
runs:
using: 'composite'
@@ -342,7 +349,7 @@ runs:
install.packages(c("rmarkdown","BiocManager"), dependencies = TRUE)
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies****'))
repos <- BiocManager::repositories()
- remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=FALSE)
+ remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=${{ inputs.force_install }})
continue-on-error: true
shell: Rscript {0}
@@ -354,7 +361,7 @@ runs:
options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout"))
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies****'))
repos <- BiocManager::repositories()
- remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=FALSE)
+ remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=${{ inputs.force_install }})
shell: Rscript {0}
- name: 🛠Install RUnit (via BiocGenerics)
From 728b74825b4286653f325269748d36b92e28716b Mon Sep 17 00:00:00 2001
From: HDash <16350928+HDash@users.noreply.github.com>
Date: Tue, 5 Nov 2024 14:49:38 +0000
Subject: [PATCH 2/8] Add rworkflows to test `force_install` input
---
.github/workflows/rworkflows_force_install.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/rworkflows_force_install.yml b/.github/workflows/rworkflows_force_install.yml
index 0fcc461d..023717e4 100644
--- a/.github/workflows/rworkflows_force_install.yml
+++ b/.github/workflows/rworkflows_force_install.yml
@@ -1,4 +1,4 @@
-name: rworkflows
+name: rworkflows_force_install
'on':
push:
branches:
@@ -36,7 +36,7 @@ jobs:
bioc: release
python-version: 3.11
steps:
- - uses: neurogenomics/rworkflows@master
+ - uses: HDash/rworkflows@force_install
with:
run_bioccheck: ${{ false }}
run_rcmdcheck: ${{ true }}
From 89ccb08775d80e33f3d5881cf8cfa5fb1ac12348 Mon Sep 17 00:00:00 2001
From: HDash <16350928+HDash@users.noreply.github.com>
Date: Tue, 5 Nov 2024 14:50:58 +0000
Subject: [PATCH 3/8] Update rworkflows branch
---
.github/workflows/rworkflows_force_install.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/rworkflows_force_install.yml b/.github/workflows/rworkflows_force_install.yml
index 023717e4..640ef348 100644
--- a/.github/workflows/rworkflows_force_install.yml
+++ b/.github/workflows/rworkflows_force_install.yml
@@ -36,7 +36,7 @@ jobs:
bioc: release
python-version: 3.11
steps:
- - uses: HDash/rworkflows@force_install
+ - uses: HDash/rworkflows@master
with:
run_bioccheck: ${{ false }}
run_rcmdcheck: ${{ true }}
From 30ff831c0445ad8a8a89eb1745c03b9882dafe7f Mon Sep 17 00:00:00 2001
From: HDash <16350928+HDash@users.noreply.github.com>
Date: Tue, 5 Nov 2024 14:56:37 +0000
Subject: [PATCH 4/8] Use different strategy for `force_install`
---
action.yml | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/action.yml b/action.yml
index 5aa3bfdf..3d6483dc 100644
--- a/action.yml
+++ b/action.yml
@@ -339,6 +339,7 @@ runs:
shell: Rscript {0}
- name: 🛠Install dependencies pass 1
+ if: inputs.force_install == 'false'
env:
timeout: ${{ inputs.timeout }}
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
@@ -349,7 +350,23 @@ runs:
install.packages(c("rmarkdown","BiocManager"), dependencies = TRUE)
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies****'))
repos <- BiocManager::repositories()
- remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=${{ inputs.force_install }})
+ remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=FALSE)
+ continue-on-error: true
+ shell: Rscript {0}
+
+ - name: 🛠Install dependencies pass 1 (Bypass cache)
+ if: inputs.force_install == 'true'
+ env:
+ timeout: ${{ inputs.timeout }}
+ GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
+ run: |
+ options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout"))
+ ## For running the checks
+ message(paste('****', Sys.time(), 'installing rcmdcheck ****'))
+ install.packages(c("rmarkdown","BiocManager"), dependencies = TRUE)
+ message(paste('****', Sys.time(), 'pass number 1 at installing dependencies****'))
+ repos <- BiocManager::repositories()
+ remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=TRUE)
continue-on-error: true
shell: Rscript {0}
@@ -361,7 +378,7 @@ runs:
options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout"))
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies****'))
repos <- BiocManager::repositories()
- remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=${{ inputs.force_install }})
+ remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=FALSE)
shell: Rscript {0}
- name: 🛠Install RUnit (via BiocGenerics)
From 493f8c79c165a6aa555ca66d20214f4d13460db9 Mon Sep 17 00:00:00 2001
From: HDash <16350928+HDash@users.noreply.github.com>
Date: Tue, 5 Nov 2024 15:02:19 +0000
Subject: [PATCH 5/8] Update package version
---
DESCRIPTION | 2 +-
NEWS.md | 7 +++++++
README.md | 44 ++++++++++++++++++++++----------------------
3 files changed, 30 insertions(+), 23 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index 8482e316..e8a0b303 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: rworkflows
Type: Package
Title: Test, Document, Containerise, and Deploy R Packages
-Version: 1.0.3
+Version: 1.0.4
Authors@R:
c(person(given = "Brian",
family = "Schilder",
diff --git a/NEWS.md b/NEWS.md
index d2b9f455..5c371002 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,10 @@
+# rworkflows 1.0.4
+
+## New features
+
+* New arg `force_install` allows users to bypass cache while installing
+ dependencies.
+
# rworkflows 1.0.3
## New features
diff --git a/README.md b/README.md
index dad2b3a2..4fe39cde 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
GPL-3](https://img.shields.io/badge/license-GPL--3-blue.svg)](https://cran.r-project.org/web/licenses/GPL-3)
[![](https://img.shields.io/badge/doi-https://doi.org/10.5281/zenodo.10048573-blue.svg)](https://doi.org/https://doi.org/10.5281/zenodo.10048573)
-[![](https://img.shields.io/badge/devel%20version-1.0.1-black.svg)](https://github.com/neurogenomics/rworkflows)
+[![](https://img.shields.io/badge/devel%20version-1.0.4-black.svg)](https://github.com/neurogenomics/rworkflows)
[![](https://img.shields.io/github/languages/code-size/neurogenomics/rworkflows.svg)](https://github.com/neurogenomics/rworkflows)
[![](https://img.shields.io/github/last-commit/neurogenomics/rworkflows.svg)](https://github.com/neurogenomics/rworkflows/commits/master)
[![R build
@@ -22,7 +22,7 @@ status](https://github.com/neurogenomics/rworkflows/workflows/rworkflows_dev/bad
Authors: Brian Schilder, Alan Murphy, Nathan Skene