diff --git a/.github/workflows/rworkflows.yml b/.github/workflows/rworkflows.yml index 900110e5..ae6b5953 100644 --- a/.github/workflows/rworkflows.yml +++ b/.github/workflows/rworkflows.yml @@ -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 @@ -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 diff --git a/.github/workflows/rworkflows_static.yml b/.github/workflows/rworkflows_static.yml index b1965387..59433240 100644 --- a/.github/workflows/rworkflows_static.yml +++ b/.github/workflows/rworkflows_static.yml @@ -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 @@ -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 diff --git a/DESCRIPTION b/DESCRIPTION index 6b61f136..0959dfb5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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", @@ -17,8 +17,12 @@ Authors@R: family = "Skene", role = c("aut"), email = "n.skene@imperial.ac.uk", - comment = c(ORCID = "0000-0002-6807-3180")) - ) + comment = c(ORCID = "0000-0002-6807-3180")), + person(given = "Hiranyamaya (Hiru)", + family = "Dash", + role = c("ctb"), + email = "hdash.work@gmail.com", + 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 diff --git a/NEWS.md b/NEWS.md index 10a69b60..0fde6095 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/README.Rmd b/README.Rmd index 44a29445..cbb59f4a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -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: diff --git a/README.md b/README.md index 4ea0a35a..f096f24c 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.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)
[![R build @@ -19,10 +19,11 @@ status](https://github.com/neurogenomics/rworkflows/workflows/rworkflows_dev/bad

-Authors: Brian Schilder, Alan Murphy, Nathan Skene +Authors: Brian Schilder, Alan Murphy, Nathan Skene, Hiranyamaya +(Hiru) Dash

-README updated: Dec-18-2024 +README updated: Mar-17-2025

[![CRAN @@ -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 @@ -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 @@ -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 diff --git a/action.yml b/action.yml index f9a9e2e0..68ee7cbe 100644 --- a/action.yml +++ b/action.yml @@ -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' @@ -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') }} @@ -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') }} @@ -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 @@ -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) diff --git a/inst/templates/rworkflows_template.yml b/inst/templates/rworkflows_template.yml index 8783359f..1416880e 100644 --- a/inst/templates/rworkflows_template.yml +++ b/inst/templates/rworkflows_template.yml @@ -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 diff --git a/tests/testthat/test-get_authors.R b/tests/testthat/test-get_authors.R index fff4a170..a8bbf872 100644 --- a/tests/testthat/test-get_authors.R +++ b/tests/testthat/test-get_authors.R @@ -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) diff --git a/vignettes/rworkflows.Rmd b/vignettes/rworkflows.Rmd index bf2323a2..f7a143d2 100644 --- a/vignettes/rworkflows.Rmd +++ b/vignettes/rworkflows.Rmd @@ -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`