From 125a611adf6a9ab94e7f80dc82f2acaa04f0142e Mon Sep 17 00:00:00 2001 From: mrustl Date: Tue, 7 Jun 2022 19:11:50 +0200 Subject: [PATCH] Do not eval vignettes on R universe (closes https://github.com/r-universe-org/help/issues/171) --- vignettes/analyse-rpackages.Rmd | 16 ++++++++-------- vignettes/codemetar-analysis.Rmd | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vignettes/analyse-rpackages.Rmd b/vignettes/analyse-rpackages.Rmd index 4ae2c7b..17edea7 100644 --- a/vignettes/analyse-rpackages.Rmd +++ b/vignettes/analyse-rpackages.Rmd @@ -18,14 +18,14 @@ knitr::opts_chunk$set( ) is_ghactions <- identical(Sys.getenv("CI"), "true") && identical(Sys.getenv("GH_ACTIONS_KWB_R"), TRUE) - +local <- FALSE ``` # Get Metadata for All KWB-R Github Repos For all Github repos also includes non R packages -```{r, eval = TRUE} +```{r, eval = is_ghactions} pkgmeta::write_github_repos_json() ``` @@ -33,13 +33,13 @@ pkgmeta::write_github_repos_json() Now limit only "public" KWB-R repos which are R packages. -```{r, eval = TRUE} +```{r, eval = is_ghactions} pkgs <- pkgmeta::get_github_packages() ``` # Define paths -```{r, eval = !is_ghactions} +```{r, eval = local} # Define paths and resolve placeholders paths_list <- list( root_dir = tempdir(), @@ -59,7 +59,7 @@ paths <- kwb.utils::resolve(paths_list, root_dir = tempdir()) in own library required for "codemetar" and "pkgnet" reports -```{r, echo = !is_ghactions, eval = !is_ghactions} +```{r, echo = FALSE, eval = local} fs::dir_create(paths$pkglib, recursive = TRUE) withr::with_libpaths(new = paths$pkglib, code = { @@ -90,7 +90,7 @@ pkgmeta::travis_pkg_install_script() required for pkgnet "covr": -```{r, echo = !is_ghactions, eval = !is_ghactions} +```{r, echo = TRUE, eval = local} fs::dir_create( path = c(paths$pkgsource_zip_dir, paths$pkgsource_unzip_dir), @@ -121,7 +121,7 @@ invisible(lapply(zipfiles, function(x) { Generating "codemetar.json" file -```{r, echo = !is_ghactions, eval = !is_ghactions} +```{r, echo = TRUE, eval = local} pkgs <- pkgmeta::get_github_packages() codemeta <- pkgmeta::create_pkg_codemeta(pkgs, libpath = paths$pkglib) @@ -149,7 +149,7 @@ pkgmeta::write_pkg_codemeta_json(codemeta) Create Reports with "pkgnet -```{r, echo = !is_ghactions, eval = !is_ghactions} +```{r, echo = TRUE, eval = local} fs::dir_create(paths$pkgnet_dir, recurse = TRUE) withr::with_libpaths(new = c(paths$pkglib, .libPaths()), diff --git a/vignettes/codemetar-analysis.Rmd b/vignettes/codemetar-analysis.Rmd index 56f67e3..cd4f9ed 100644 --- a/vignettes/codemetar-analysis.Rmd +++ b/vignettes/codemetar-analysis.Rmd @@ -136,7 +136,7 @@ wordcloud2::wordcloud2(maintainer, ``` -```{r, eval = TRUE} +```{r, eval = is_ghactions} ## number of co-authors ... purrr::map_int(corpus, function(r) length(r$author)) %>% tibble::enframe() %>%