From a7ac9de127ff7d146c2455d1075aa0660ebf1485 Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:56:01 +0200 Subject: [PATCH 1/5] add extra_deps parameter --- README.md | 8 ++++++++ action.yaml | 8 ++++++-- script.R | 13 +++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8d63927..4bbd0c0 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,14 @@ Insights Engineering _Default_: `repository` +* `extra-deps`: + + _Description_: Extra dependencies specified similarly to the `DESCRIPTION` file, i.e. `" ( )"` where both `` and `` are optional. Multiple entries are possible separated by `";"`. + + _Required_: `false` + + _Default_: `""` + * `check-args`: _Description_: Optional value of `args` argument to `rcmdcheck::rcmdcheck` in form of a string with space as delimeter, e.g. `"--no-examples --no-tests"`. diff --git a/action.yaml b/action.yaml index 99ad9c6..719cac5 100644 --- a/action.yaml +++ b/action.yaml @@ -12,6 +12,10 @@ inputs: description: Directory where the checked package has been cloned. required: false default: "." + extra-deps: + description: Extra dependencies specified similarly to the `DESCRIPTION` file, i.e. `" ( )"` where both `` and `` are optional. Multiple entries are possible separated by `";"`. + required: false + default: "" check-args: description: Optional value of args argument to rcmdcheck::rcmdcheck in form of a string with space as delimeter, e.g. "--no-examples --no-tests". required: false @@ -22,7 +26,7 @@ inputs: default: "" strategy: description: | - Strategy to test package dependencies. One of: min, release, max. + Strategy to test package dependencies. One of: min_isolated, min_cohort, release, max. required: true additional-env-vars: description: | @@ -53,7 +57,7 @@ runs: echo ".libPaths(\" \", include.site = FALSE)" > .Rprofile export R_LIBS_SITE=" " export R_LIBS_USER=" " - Rscript ${GITHUB_ACTION_PATH}/script.R '${{ inputs.repository-path }}' '${{ inputs.build-args }}' '${{ inputs.check-args }}' '${{ inputs.strategy }}' + Rscript ${GITHUB_ACTION_PATH}/script.R '${{ inputs.repository-path }}' '${{ inputs.extra-deps }}' '${{ inputs.build-args }}' '${{ inputs.check-args }}' '${{ inputs.strategy }}' shell: bash env: GITHUB_PAT: "${{ inputs.github-token }}" diff --git a/script.R b/script.R index 2e59e36..870ba44 100644 --- a/script.R +++ b/script.R @@ -11,20 +11,21 @@ catnl_param <- function(x = "") { catnl("Install required packages") install.packages(c("remotes", "cli"), quiet = TRUE, verbose = FALSE) -remotes::install_github("insightsengineering/verdepcheck", quiet = TRUE, verbose = FALSE) +remotes::install_github("insightsengineering/verdepcheck@add_extra", quiet = TRUE, verbose = FALSE) remotes::install_github("r-lib/rcmdcheck#196", quiet = TRUE, verbose = FALSE) # TODO: remove when merged / linked issue fixed args <- commandArgs(trailingOnly = TRUE) path <- normalizePath(file.path(".", args[1])) -build_args <- strsplit(args[2], " ")[[1]] -check_args <- strsplit(args[3], " ")[[1]] -strategy <- strsplit(args[4], " ")[[1]] +extra_deps <- strsplit(args[2], " ")[[1]] +build_args <- strsplit(args[3], " ")[[1]] +check_args <- strsplit(args[4], " ")[[1]] +strategy <- strsplit(args[5], " ")[[1]] cli::cli_h1("Cat script parameters") catnl_param(path) +catnl_param(extra_deps) catnl_param(build_args) catnl_param(check_args) -catnl_param(strategy) cli::cli_h1("Execute verdepcheck...") fun <- switch( @@ -35,7 +36,7 @@ fun <- switch( "max" = verdepcheck::max_deps_check, stop("Unknown strategy") ) -x <- fun(path, check_args = check_args, build_args = build_args) +x <- fun(path, extra_deps = extra_deps, check_args = check_args, build_args = build_args) saveRDS(x, "res.RDS") cli::cli_h1("Debug output:") From 72157112ddc9d7ce83d40b8ccfb29b9dd9dca718 Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:16:59 +0200 Subject: [PATCH 2/5] add trimws() --- script.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.R b/script.R index 870ba44..fe91b08 100644 --- a/script.R +++ b/script.R @@ -14,7 +14,7 @@ install.packages(c("remotes", "cli"), quiet = TRUE, verbose = FALSE) remotes::install_github("insightsengineering/verdepcheck@add_extra", quiet = TRUE, verbose = FALSE) remotes::install_github("r-lib/rcmdcheck#196", quiet = TRUE, verbose = FALSE) # TODO: remove when merged / linked issue fixed -args <- commandArgs(trailingOnly = TRUE) +args <- trimws(commandArgs(trailingOnly = TRUE)) path <- normalizePath(file.path(".", args[1])) extra_deps <- strsplit(args[2], " ")[[1]] build_args <- strsplit(args[3], " ")[[1]] From fae5a82c8183e29f8f25fafa3a3edd0eef0c369e Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:39:41 +0200 Subject: [PATCH 3/5] rm strsplit if not needed --- script.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script.R b/script.R index fe91b08..033a225 100644 --- a/script.R +++ b/script.R @@ -16,10 +16,10 @@ remotes::install_github("r-lib/rcmdcheck#196", quiet = TRUE, verbose = FALSE) # args <- trimws(commandArgs(trailingOnly = TRUE)) path <- normalizePath(file.path(".", args[1])) -extra_deps <- strsplit(args[2], " ")[[1]] +extra_deps <- args[2] build_args <- strsplit(args[3], " ")[[1]] check_args <- strsplit(args[4], " ")[[1]] -strategy <- strsplit(args[5], " ")[[1]] +strategy <- args[5] cli::cli_h1("Cat script parameters") catnl_param(path) From 1a0c20f0035ced24a6c7dfaa02234b9d9233befe Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Mon, 24 Jun 2024 18:04:52 +0200 Subject: [PATCH 4/5] docs enhancements --- README.md | 2 +- action.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4bbd0c0..1a9b6ae 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Insights Engineering * `extra-deps`: - _Description_: Extra dependencies specified similarly to the `DESCRIPTION` file, i.e. `" ( )"` where both `` and `` are optional. Multiple entries are possible separated by `";"`. + _Description_: Extra dependencies specified similarly as in the `DESCRIPTION` file, i.e. `" ( )"` where both `` and `` are optional. Multiple entries are possible separated by `";"`. _Required_: `false` diff --git a/action.yaml b/action.yaml index 719cac5..e31d3ff 100644 --- a/action.yaml +++ b/action.yaml @@ -13,7 +13,7 @@ inputs: required: false default: "." extra-deps: - description: Extra dependencies specified similarly to the `DESCRIPTION` file, i.e. `" ( )"` where both `` and `` are optional. Multiple entries are possible separated by `";"`. + description: Extra dependencies specified similarly as in the `DESCRIPTION` file, i.e. `" ( )"` where both `` and `` are optional. Multiple entries are possible separated by `";"`. required: false default: "" check-args: From 06b4559255a5a035b4398a27967e0d28815a1f48 Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:57:54 +0200 Subject: [PATCH 5/5] Update script.R Signed-off-by: Pawel Rucki <12943682+pawelru@users.noreply.github.com> --- script.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.R b/script.R index 033a225..80ecc93 100644 --- a/script.R +++ b/script.R @@ -11,7 +11,7 @@ catnl_param <- function(x = "") { catnl("Install required packages") install.packages(c("remotes", "cli"), quiet = TRUE, verbose = FALSE) -remotes::install_github("insightsengineering/verdepcheck@add_extra", quiet = TRUE, verbose = FALSE) +remotes::install_github("insightsengineering/verdepcheck", quiet = TRUE, verbose = FALSE) remotes::install_github("r-lib/rcmdcheck#196", quiet = TRUE, verbose = FALSE) # TODO: remove when merged / linked issue fixed args <- trimws(commandArgs(trailingOnly = TRUE))