Skip to content

v1.0.7 - Improve dependency install speed + more #141

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/rworkflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- os: ubuntu-latest
r: auto
bioc: release
cont: ghcr.io/bioconductor/bioconductor_docker:RELEASE_3_19
cont: ghcr.io/bioconductor/bioconductor_docker:RELEASE_3_20
python-version: 3.11
- os: macOS-latest
r: latest
Expand All @@ -50,7 +50,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run_docker: ${{ true }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
runner_os: ${{ runner.os }}
cache_version: cache-v1
ncpus: 2
# free_diskspace: ${{ true }}
# miniforge_variant: false
4 changes: 2 additions & 2 deletions .github/workflows/rworkflows_static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
- name: "\U0001F3E6 Restore R package cache"
if: |
!contains(github.event.head_commit.message, '[nocache]') && runner.os != 'Linux'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ env.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc
Expand All @@ -131,7 +131,7 @@ jobs:
- name: "\U0001F3E6 Cache R packages on Linux"
if: |
!contains(github.event.head_commit.message, '[nocache]') && runner.os == 'Linux'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /home/runner/work/_temp/Library
key: ${{ env.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc
Expand Down
10 changes: 7 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rworkflows
Type: Package
Title: Test, Document, Containerise, and Deploy R Packages
Version: 1.0.6
Version: 1.0.7
Authors@R:
c(person(given = "Brian",
family = "Schilder",
Expand All @@ -17,8 +17,12 @@ Authors@R:
family = "Skene",
role = c("aut"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-6807-3180"))
)
comment = c(ORCID = "0000-0002-6807-3180")),
person(given = "Hiranyamaya (Hiru)",
family = "Dash",
role = c("ctb"),
email = "[email protected]",
comment = c(ORCID = "0009-0005-5514-505X")))
Description: Reproducibility is essential to the progress of research,
yet achieving it remains elusive even in computational fields.
Continuous Integration (CI) platforms offer a powerful way to launch automated workflows
Expand Down
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# rworkflows 1.0.7

## New features

* New arg for number of cores to use for R package installation (`ncpus`).
* Add `CODECOV_TOKEN` and `ncpus` to `rworkflows.yml` template.
* Update to `actions/cache@v4` as v3 is marked for deprecation.
## Documentation
* Mention `CODECOV_TOKEN` in GitHub Secrets section.


# rworkflows 1.0.6

## Bug fixes
Expand Down
6 changes: 5 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ To use certain features of `rworkflows`, you may need to set up one or more
repos on GitHub Actions. You can generate your very own Personal
Authentication Token with `usethis::create_github_token()`. See the [GitHub docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for details.
* `DOCKER_TOKEN` [Optional]: Allows GitHub Actions to push to a
[DockerHub](https://hub.docker.com) account.
[DockerHub](https://hub.docker.com) account.
* `CODECOV_TOKEN` [Optional]: Codecov repository token to upload coverage
reports. Providing this token helps prevent report upload failures by
bypassing Codecov's GitHub API rate limits. See the [Codecov documentation](https://docs.codecov.com/docs/adding-the-codecov-token)
for details.

## Acknowledgments
`rworkflows` builds upon the work of many others, especially the following:
Expand Down
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<br>
[![](https://img.shields.io/badge/devel%20version-1.0.5-black.svg)](https://github.com/neurogenomics/rworkflows)
[![](https://img.shields.io/badge/devel%20version-1.0.7-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)
<br> [![R build
Expand All @@ -19,10 +19,11 @@ status](https://github.com/neurogenomics/rworkflows/workflows/rworkflows_dev/bad
<br>
<a href='https://app.codecov.io/gh/neurogenomics/rworkflows/tree/master' target='_blank'><img src='https://codecov.io/gh/neurogenomics/rworkflows/branch/master/graphs/icicle.svg' title='Codecov icicle graph' width='200' height='50' style='vertical-align: top;'></a>
<h4>
Authors: <i>Brian Schilder, Alan Murphy, Nathan Skene</i>
Authors: <i>Brian Schilder, Alan Murphy, Nathan Skene, Hiranyamaya
(Hiru) Dash</i>
</h4>
<h4>
README updated: <i>Dec-18-2024</i>
README updated: <i>Mar-17-2025</i>
</h4>

[![CRAN
Expand Down Expand Up @@ -190,7 +191,13 @@ Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets):
docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
for details.
- `DOCKER_TOKEN` \[Optional\]: Allows GitHub Actions to push to a
[DockerHub](https://hub.docker.com) account.
[DockerHub](https://hub.docker.com) account.
- `CODECOV_TOKEN` \[Optional\]: Codecov repository token to upload
coverage reports. Providing this token helps prevent report upload
failures by bypassing Codecov’s GitHub API rate limits. See the
[Codecov
documentation](https://docs.codecov.com/docs/adding-the-codecov-token)
for details.

## Acknowledgments

Expand Down Expand Up @@ -287,9 +294,9 @@ GitHub Action to setup Miniconda and conda environments.
utils::sessionInfo()
```

## R version 4.4.1 (2024-06-14)
## R version 4.4.2 (2024-10-31)
## Platform: aarch64-apple-darwin20
## Running under: macOS 15.1
## Running under: macOS Sequoia 15.3.1
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib
Expand All @@ -305,21 +312,20 @@ utils::sessionInfo()
## [1] stats graphics grDevices utils datasets methods base
##
## loaded via a namespace (and not attached):
## [1] gtable_0.3.6 jsonlite_1.8.9 renv_1.0.11
## [4] dplyr_1.1.4 compiler_4.4.1 BiocManager_1.30.25
## [1] gtable_0.3.6 jsonlite_1.9.1 renv_1.1.2
## [4] dplyr_1.1.4 compiler_4.4.2 BiocManager_1.30.25
## [7] tidyselect_1.2.1 rvcheck_0.2.1 scales_1.3.0
## [10] yaml_2.3.10 fastmap_1.2.0 here_1.0.1
## [13] ggplot2_3.5.1 R6_2.5.1 generics_0.1.3
## [16] knitr_1.48 yulab.utils_0.1.7 tibble_3.2.1
## [19] desc_1.4.3 dlstats_0.1.7 rprojroot_2.0.4
## [22] munsell_0.5.1 pillar_1.9.0 RColorBrewer_1.1-3
## [25] rlang_1.1.4 utf8_1.2.4 badger_0.2.4
## [28] xfun_0.49 fs_1.6.5 cli_3.6.3
## [31] magrittr_2.0.3 rworkflows_1.0.4 digest_0.6.37
## [34] grid_4.4.1 rstudioapi_0.17.1 lifecycle_1.0.4
## [37] vctrs_0.6.5 evaluate_1.0.1 glue_1.8.0
## [40] data.table_1.16.2 fansi_1.0.6 colorspace_2.1-1
## [43] rmarkdown_2.29 tools_4.4.1 pkgconfig_2.0.3
## [46] htmltools_0.5.8.1
## [13] ggplot2_3.5.1 R6_2.6.1 generics_0.1.3
## [16] knitr_1.49 yulab.utils_0.2.0 tibble_3.2.1
## [19] desc_1.4.3 dlstats_0.1.7 munsell_0.5.1
## [22] rprojroot_2.0.4 pillar_1.10.1 RColorBrewer_1.1-3
## [25] rlang_1.1.5 badger_0.2.4 xfun_0.51
## [28] fs_1.6.5 cli_3.6.4 magrittr_2.0.3
## [31] rworkflows_1.0.7 digest_0.6.37 grid_4.4.2
## [34] rstudioapi_0.17.1 lifecycle_1.0.4 vctrs_0.6.5
## [37] evaluate_1.0.3 glue_1.8.0 data.table_1.17.0
## [40] colorspace_2.1-1 rmarkdown_2.29 tools_4.4.2
## [43] pkgconfig_2.0.3 htmltools_0.5.8.1

</details>
17 changes: 13 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ inputs:
Recommended to set to `true` when pushing changes without updating R
package version, such as during pre-release phase of developement.
default: false
ncpus:
description: >
Number of CPUs to use for R package installation. Higher values can speed
up the dependency installation process but may result in spurious errors.
Default is 2.
default: 2

runs:
using: 'composite'
Expand Down Expand Up @@ -257,7 +263,7 @@ runs:
- name: 🏦 Restore R package cache
if: |
!contains(github.event.head_commit.message, '[nocache]') && runner.os != 'Linux'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ inputs.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
Expand All @@ -266,7 +272,7 @@ runs:
- name: 🏦 Cache R packages on Linux
if: |
!contains(github.event.head_commit.message, '[nocache]') && runner.os == 'Linux'
uses: actions/cache@v3
uses: actions/cache@v4
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') }}
Expand Down Expand Up @@ -343,12 +349,14 @@ runs:
timeout: ${{ inputs.timeout }}
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
force_install: ${{ inputs.force_install }}
ncpus: ${{ inputs.ncpus }}
run: |
options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout"))
options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout"), Ncpus=as.integer(Sys.getenv("ncpus")))
## 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****'))
message(paste('**** Using', Sys.getenv("ncpus"), 'cores for installation.'))
repos <- BiocManager::repositories()
remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=Sys.getenv("force_install"))
continue-on-error: true
Expand All @@ -358,8 +366,9 @@ runs:
env:
timeout: ${{ inputs.timeout }}
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
ncpus: ${{ inputs.ncpus }}
run: |
options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout"))
options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout"), Ncpus=as.integer(Sys.getenv("ncpus")))
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)
Expand Down
2 changes: 2 additions & 0 deletions inst/templates/rworkflows_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@
docker_user: 'bschilder'
docker_org: 'neurogenomicslab'
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
runner_os: ${{ runner.os }}
cache_version: cache-master
ncpus: 2
2 changes: 1 addition & 1 deletion tests/testthat/test-get_authors.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("get_authors works", {

true_auths <- "Brian Schilder, Alan Murphy, Nathan Skene"
true_auths <- "Brian Schilder, Alan Murphy, Nathan Skene, Hiranyamaya (Hiru) Dash"
#### ref is NULL ####
auths1 <- get_authors(ref = NULL)
testthat::expect_null(auths1)
Expand Down
6 changes: 5 additions & 1 deletion vignettes/rworkflows.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ Before pushing changes to your new R package, you may want to set up one or more
Authentication Token using [these
instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
* `DOCKER_TOKEN` [Optional]: Allows GitHub Actions to push to a
[DockerHub](https://hub.docker.com) account.
[DockerHub](https://hub.docker.com) account.
* `CODECOV_TOKEN` [Optional]: Codecov repository token to upload coverage
reports. Providing this token helps prevent report upload failures by
bypassing Codecov's GitHub API rate limits. See the [Codecov documentation](https://docs.codecov.com/docs/adding-the-codecov-token)
for details.

# `use_workflow`

Expand Down
Loading