diff --git a/.github/workflows/R-CMD-check-no-suggests.yaml b/.github/workflows/R-CMD-check-no-suggests.yaml new file mode 100644 index 0000000..c06bf8f --- /dev/null +++ b/.github/workflows/R-CMD-check-no-suggests.yaml @@ -0,0 +1,60 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +# +# NOTE: This workflow only directly installs "hard" dependencies, i.e. Depends, +# Imports, and LinkingTo dependencies. Notably, Suggests dependencies are never +# installed, with the exception of testthat, knitr, and rmarkdown. The cache is +# never used to avoid accidentally restoring a cache containing a suggested +# dependency. +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check-no-suggests.yaml + +permissions: read-all + +jobs: + check-no-suggests: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: ubuntu-latest, r: 'release'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + dependencies: '"hard"' + cache: false + extra-packages: | + any::rcmdcheck + any::testthat + any::knitr + any::rmarkdown + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/R/leave_var_out_formulas.R b/R/leave_var_out_formulas.R index b7741ca..cf43e2e 100644 --- a/R/leave_var_out_formulas.R +++ b/R/leave_var_out_formulas.R @@ -14,7 +14,7 @@ #' #' Factor predictors are left as-is (i.e., no indicator variables are created). #' -#' @examples +#' @examplesIf rlang::is_installed("modeldata") #' data(penguins, package = "modeldata") #' #' leave_var_out_formulas( diff --git a/README.Rmd b/README.Rmd index ac4e21e..af5e3c7 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,6 +17,7 @@ knitr::opts_chunk$set( [![R-CMD-check](https://github.com/tidymodels/workflowsets/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidymodels/workflowsets/actions/workflows/R-CMD-check.yaml) +[![R-CMD-check-no-suggests](https://github.com/tidymodels/workflowsets/actions/workflows/R-CMD-check-no-suggests.yaml/badge.svg)](https://github.com/tidymodels/workflowsets/actions/workflows/R-CMD-check-no-suggests.yaml) [![Codecov test coverage](https://codecov.io/gh/tidymodels/workflowsets/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/workflowsets?branch=main) [![Lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html) diff --git a/README.md b/README.md index d3ef5aa..4676c2b 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![R-CMD-check](https://github.com/tidymodels/workflowsets/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidymodels/workflowsets/actions/workflows/R-CMD-check.yaml) +[![R-CMD-check-no-suggests](https://github.com/tidymodels/workflowsets/actions/workflows/R-CMD-check-no-suggests.yaml/badge.svg)](https://github.com/tidymodels/workflowsets/actions/workflows/R-CMD-check-no-suggests.yaml) [![Codecov test coverage](https://codecov.io/gh/tidymodels/workflowsets/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/workflowsets?branch=main) [![Lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html) diff --git a/man/leave_var_out_formulas.Rd b/man/leave_var_out_formulas.Rd index 8798174..14c6bdb 100644 --- a/man/leave_var_out_formulas.Rd +++ b/man/leave_var_out_formulas.Rd @@ -30,6 +30,7 @@ such terms). Factor predictors are left as-is (i.e., no indicator variables are created). } \examples{ +\dontshow{if (rlang::is_installed("modeldata")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} data(penguins, package = "modeldata") leave_var_out_formulas( @@ -47,6 +48,7 @@ leave_var_out_formulas( I(flipper_length_mm^2), data = penguins ) +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=workflow_set]{workflow_set()}} diff --git a/tests/testthat/test-collect-predictions.R b/tests/testthat/test-collect-predictions.R index fa5aa0f..1c06d58 100644 --- a/tests/testthat/test-collect-predictions.R +++ b/tests/testthat/test-collect-predictions.R @@ -1,4 +1,6 @@ skip_on_cran() +skip_if_not_installed("kknn") +skip_if_not_installed("modeldata") # ------------------------------------------------------------------------------ diff --git a/tests/testthat/test-extract.R b/tests/testthat/test-extract.R index 6b31743..98b9a6b 100644 --- a/tests/testthat/test-extract.R +++ b/tests/testthat/test-extract.R @@ -1,3 +1,5 @@ +skip_if_not_installed(c("kknn", "modeldata")) + library(parsnip) library(rsample) library(recipes) diff --git a/tests/testthat/test-fit_best.R b/tests/testthat/test-fit_best.R index 16350b4..c944018 100644 --- a/tests/testthat/test-fit_best.R +++ b/tests/testthat/test-fit_best.R @@ -1,3 +1,6 @@ +skip_if_not_installed("kknn") +skip_if_not_installed("modeldata") + test_that("fit_best fits with correct hyperparameters", { skip_on_cran() diff --git a/tests/testthat/test-updates.R b/tests/testthat/test-updates.R index fa883ad..5116cae 100644 --- a/tests/testthat/test-updates.R +++ b/tests/testthat/test-updates.R @@ -1,3 +1,6 @@ +skip_if_not_installed("kknn") +skip_if_not_installed("modeldata") + library(parsnip) library(recipes) library(hardhat) diff --git a/tests/testthat/test-workflow-map.R b/tests/testthat/test-workflow-map.R index cf2b83a..e685651 100644 --- a/tests/testthat/test-workflow-map.R +++ b/tests/testthat/test-workflow-map.R @@ -1,3 +1,6 @@ +skip_if_not_installed("kknn") +skip_if_not_installed("modeldata") + library(parsnip) suppressPackageStartupMessages(library(rsample)) suppressPackageStartupMessages(library(tune)) @@ -81,8 +84,6 @@ test_that("map logging", { ) }) - - test_that("missing packages", { skip_if(rlang::is_installed("glmnet")) car_set_2 <- diff --git a/vignettes/evaluating-different-predictor-sets.Rmd b/vignettes/evaluating-different-predictor-sets.Rmd index c2bf6f2..6681f46 100644 --- a/vignettes/evaluating-different-predictor-sets.Rmd +++ b/vignettes/evaluating-different-predictor-sets.Rmd @@ -10,6 +10,7 @@ vignette: > ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, + eval = rlang::is_installed(c("modeldata", "recipes")), comment = "#>" ) library(parsnip)