diff --git a/.Rhistory b/.Rhistory index fc99a7ec..a89306dd 100644 --- a/.Rhistory +++ b/.Rhistory @@ -1,52 +1,3 @@ -jsn <- jsonlite::read_json(path) -names(jsn) -testthat::expect_true( -all(c("image","features","customizations") %in% names(jsn)) -) -devtools::check_man() -file.edit("Rprofile") -file.edit(".Rprofile") -BiocManager::repositories() -devtools::check_man() -library(rworkflows) -deparse(BiocManager::repositories()) -cat(deparse(BiocManager::repositories())) -cont4 <- construct_cont(default_tag = "release", -default_registry = "ghcr.io", -run_check_cont = TRUE) -cont4 <- construct_cont(default_tag = "release", -default_registry = NULL, -run_check_cont = TRUE) -is.null(c("a","b")) -library(rworkflows) -cont4 <- construct_cont(default_tag = "release", -default_registry = NULL, -run_check_cont = TRUE) -devoptera::args2vars(construct_cont) -default_registry -default_registry=NULL -default_registry <- check_registry(registry = default_registry) -#### Remove any trailing : (e.g. when default_tag=NULL) #### -cont <- lapply(cont, function(x){ -if(is.null(x)) NULL else trimws(x,whitespace = ":") -}) -#### Run QC #### -cont2 <- lapply(cont,function(co){ -if(is.null(co)){ -return(NULL) -} else if(!grepl("/",co) && -!is.null(default_cont)){ -messager("Only tag name supplied to 'cont'.", -"Assuming default=",shQuote(default_cont),v=verbose) -co <- paste(default_cont,co,sep=":") -} else if(!grepl(":",co) | -!grepl(default_cont,co)) { -return(co) -} -splt <- strsplit(co,":")[[1]] -bioc_version <- rev(splt)[1] -if(isTRUE(versions_explicit)){ -if(grepl(":",co)){ info <- bioc_r_versions(bioc_version = bioc_version) return( paste0(splt[[1]],":RELEASE_",gsub("[.]","_",info$bioc)) @@ -510,3 +461,52 @@ library(rworkflows) ?testthat::skip_on_cran() testthat::skip_if_offline() readLines("https://hub.docker.com/v2/repositories//bioconductor/bioconductor_docker/tags?page_size=1000") +devtools::check_man() +devtools::install_dev_deps() +devtools::install_dev_deps() +gh::gh_token() +file.edit("~/.Renviron") +credentials::set_github_pat() +gh::gh_token() +devtools::install_dev_deps() +credentials::set_github_pat() +devtools::install_dev_deps() +devtools::build() +devtools::check_man() +version +version +install.packages("devtools") +install.packages("BiocManager") +install.packages("devtools") +devtools::install_dev_deps() +devtools::check_man() +install.packages("roxygen2") +devtools::check_man() +devtools::install_dev_deps() +packageVersion("roxygen2") +version +version +version() +version() +version +rworkflows::use_workflow() +rworkflows::use_workflow(force_new = T) +gh::gh_token() +credentials::set_github_pat() +a1 <- construct_authors() +library() +library(rworkflows) +a1 <- construct_authors() +testthat::expect_equal(as.character(a1), "yourGivenName yourFamilyName [cre] (yourOrcidId)") +a2 <- construct_authors(authors = "Test 1, Test1") +testthat::expect_equal(as.character(a2), "Test 1, Test1") +testthat::expect_equal(as.character(a1), "yourGivenName yourFamilyName [cre] (yourOrcidId)") +testthat::expect_true(as.character(a1) %in% +c("yourGivenName yourFamilyName [cre] (ORCID: yourOrcidId)", +"yourGivenName yourFamilyName [cre] (yourOrcidId)")) +installed.packages() +names(installed.packages()) +rownames(installed.packages()) +"reticulate" %in% rownames(installed.packages()) +credentials::set_github_pat() +remotes::install_github("r-lib/remotes") diff --git a/DESCRIPTION b/DESCRIPTION index 23d841da..8482e316 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rworkflows Type: Package Title: Test, Document, Containerise, and Deploy R Packages -Version: 1.0.2 +Version: 1.0.3 Authors@R: c(person(given = "Brian", family = "Schilder", diff --git a/NEWS.md b/NEWS.md index 695d0f59..d2b9f455 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,14 +1,26 @@ +# rworkflows 1.0.3 + +## New features + +* New arg `run_telemetry` allows users to disable workflow telemetry. + +## Bug fixes + +* Add `GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}` to all code check steps. + # rworkflows 1.0.2 ## New features -* Update to R 4.4.1 and ensure everything stil works. +* Update to R 4.4.1 and ensure everything still works. * Update *rworkflows.yml* to use new Bioc release, 3.19 ## Bug fixes * Get back up on CRAN after deprecation occurred while I was away. * Remove .*Rprofile* (didn't seem to help CRAN and was getting outdated) +* *test-construct_conda_yml.R*: Add conditional to only run certain steps + if `reticulate` is installed (for `noSuggests` tests in CRAN). # rworkflows 1.0.1 diff --git a/action.yml b/action.yml index a66ac459..aca14b7a 100644 --- a/action.yml +++ b/action.yml @@ -164,11 +164,17 @@ inputs: description: > Free up additional disk space by deleting non-essential sofwares. default: false + run_telemetry: + description: > + Whether to run the workflow telemetry action: + https://github.com/catchpoint/workflow-telemetry-action + default: true runs: using: 'composite' steps: - name: 🔭 Collect Workflow Telemetry + if: inputs.run_telemetry == 'true' uses: runforesight/workflow-telemetry-action@v1 continue-on-error: true with: @@ -391,6 +397,7 @@ runs: AS_CRAN: ${{ inputs.as_cran }} run_vignettes: ${{ inputs.run_vignettes }} timeout: ${{ inputs.timeout }} + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) if(!require("rcmdcheck", quietly=TRUE)) install.packages("rcmdcheck") @@ -414,6 +421,7 @@ runs: if: inputs.has_runit == 'true' env: timeout: ${{ inputs.timeout }} + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) BiocGenerics:::testPackage() @@ -427,6 +435,7 @@ runs: run_vignettes: ${{ inputs.run_vignettes }} as_cran: ${{ inputs.as_cran }} timeout: ${{ inputs.timeout }} + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) #### Install deps #### @@ -449,6 +458,7 @@ runs: if: inputs.run_covr == 'true' && runner.os == 'Linux' env: CODECOV_TOKEN: ${{ inputs.CODECOV_TOKEN }} + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | ## NOTE: codecov() uses CODECOV_TOKEN env var if specified. ## (recommended) @@ -457,6 +467,8 @@ runs: - name: 🛠 Install package ️ if: inputs.run_pkgdown == 'true' && runner.os == 'Linux' + env: + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: R CMD INSTALL . shell: bash {0} @@ -507,6 +519,8 @@ runs: - name: 📦 Build pkgdown site if: inputs.run_pkgdown == 'true' && runner.os == 'Linux' + env: + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | options(crayon.enabled = TRUE) pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) diff --git a/tests/testthat/test-construct_authors.R b/tests/testthat/test-construct_authors.R index 88088624..4796fdaa 100644 --- a/tests/testthat/test-construct_authors.R +++ b/tests/testthat/test-construct_authors.R @@ -1,7 +1,10 @@ test_that("construct_authors works", { a1 <- construct_authors() - testthat::expect_equal(as.character(a1), "yourGivenName yourFamilyName [cre] (yourOrcidId)") + + testthat::expect_true(as.character(a1) %in% + c("yourGivenName yourFamilyName [cre] (ORCID: yourOrcidId)", + "yourGivenName yourFamilyName [cre] (yourOrcidId)")) a2 <- construct_authors(authors = "Test 1, Test1") testthat::expect_equal(as.character(a2), "Test 1, Test1") diff --git a/tests/testthat/test-construct_conda_yml.R b/tests/testthat/test-construct_conda_yml.R index 0b039879..a98b9c5b 100644 --- a/tests/testthat/test-construct_conda_yml.R +++ b/tests/testthat/test-construct_conda_yml.R @@ -30,7 +30,8 @@ test_that("construct_conda_yml works", { #### Construct an actual conda env #### - if(conda_installed() && + if("reticulate" %in% rownames(installed.packages()) && + conda_installed() && is_gha() && .Platform$OS.type != "windows"){ envname <- "testenv"