diff --git a/README.md b/README.md index 8d63927..1a9b6ae 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,14 @@ Insights Engineering _Default_: `repository` +* `extra-deps`: + + _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`: _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..e31d3ff 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 as in 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..80ecc93 100644 --- a/script.R +++ b/script.R @@ -14,17 +14,18 @@ install.packages(c("remotes", "cli"), 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 <- commandArgs(trailingOnly = TRUE) +args <- trimws(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 <- args[2] +build_args <- strsplit(args[3], " ")[[1]] +check_args <- strsplit(args[4], " ")[[1]] +strategy <- args[5] 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:")