From f67e14b088e2dda513ee96889ca0e8332099fe08 Mon Sep 17 00:00:00 2001 From: Ernest Guevarra Date: Fri, 30 Jan 2026 11:20:01 +0000 Subject: [PATCH 1/2] create function for adding r-universet tests workflow; fix #73 --- R/add_github_action.R | 8 +++++--- inst/actions/r-universe-test.yaml | 12 ++++++++++++ man/add_github_action.Rd | 5 +++-- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 inst/actions/r-universe-test.yaml diff --git a/R/add_github_action.R b/R/add_github_action.R index 71c4c83..dc139c6 100644 --- a/R/add_github_action.R +++ b/R/add_github_action.R @@ -3,8 +3,9 @@ #' #' @param gha_name Short name of GitHub Action to add. Currently supports #' GitHub Action for Netlify deployment of testing version of pkgdown website -#' (*"netlify"*) and GitHub Action for mirroring to Codeberg -#' (*"mirror-codeberg"*). +#' (*"netlify"*), GitHub Action for mirroring to Codeberg +#' (*"mirror-codeberg"*), and GitHub Action for R-universe testing +#' (*"r-universe-test"*). #' @param overwrite Logical. Should an existing GitHub Action be overwritten? #' Default is FALSE. #' @param repo Short remote git repository name. If NULL, is determined based @@ -94,7 +95,8 @@ choose_gha_workflow <- function(gha_name) { workflows <- c( "netlify" = "Preview pkgdown website on pull request via Netlify", - "mirror-codeberg" = "Mirror repository to Codeberg" + "mirror-codeberg" = "Mirror repository to Codeberg", + "r-universe-test" = "Test R-universe" ) options <- paste0(cli::style_bold(names(workflows)), ": ", workflows) diff --git a/inst/actions/r-universe-test.yaml b/inst/actions/r-universe-test.yaml new file mode 100644 index 0000000..1bc2fe0 --- /dev/null +++ b/inst/actions/r-universe-test.yaml @@ -0,0 +1,12 @@ +name: Test R-universe + +on: + push: + pull_request: + +jobs: + build: + name: R-universe testing + uses: r-universe-org/workflows/.github/workflows/build.yml@v3 + with: + universe: ${{ github.repository_owner }} diff --git a/man/add_github_action.Rd b/man/add_github_action.Rd index 14d6502..905d04e 100644 --- a/man/add_github_action.Rd +++ b/man/add_github_action.Rd @@ -9,8 +9,9 @@ add_github_action(gha_name = NULL, repo = NULL, overwrite = FALSE) \arguments{ \item{gha_name}{Short name of GitHub Action to add. Currently supports GitHub Action for Netlify deployment of testing version of pkgdown website -(\emph{"netlify"}) and GitHub Action for mirroring to Codeberg -(\emph{"mirror-codeberg"}).} +(\emph{"netlify"}), GitHub Action for mirroring to Codeberg +(\emph{"mirror-codeberg"}), and GitHub Action for R-universe testing +(\emph{"r-universe-test"}).} \item{repo}{Short remote git repository name. If NULL, is determined based on current git settings. Evaluated only if \code{gha_name} is From e2efad1a06aaa7b9b52e386edf3a1b8286ebf684 Mon Sep 17 00:00:00 2001 From: Ernest Guevarra Date: Fri, 30 Jan 2026 11:20:01 +0000 Subject: [PATCH 2/2] create function for adding r-universet tests workflow; fix #73 --- README.Rmd | 13 ++++++++++--- README.md | 17 ++++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/README.Rmd b/README.Rmd index 1ce3183..dd6db86 100644 --- a/README.Rmd +++ b/README.Rmd @@ -41,13 +41,13 @@ Currently, `{pakete}` includes functions for: 5. adding [Zenodo](https://zenodo.org/) DOI badge; and, -6. adding specific GitHub Actions such as test deployment of package website to [Netlify](https://www.netlify.com/) and mirroring of repository to [Codeberg](https://codeberg.org/). +6. adding specific GitHub Actions such as test deployment of package website to [Netlify](https://www.netlify.com/), mirroring of repository to [Codeberg](https://codeberg.org/), and [R Universe](https://ropensci.org/blog/2026/01/03/r-universe-workflows/) testing. ## Installation You can install `{pakete}` via the [Katilingban R Universe](https://katilingban.r-universe.dev) as follows: -```{r install-r-universe, eval = FALSE} +```R install.packages( "pakete", repos = c( @@ -56,6 +56,13 @@ install.packages( ) ``` +You can also install `{pakete}` from [GitHub](https://github.com/katilingban/pakete) using the `{pak}` package with: + +```R +if (!require("pak")) install.packages("pak") +pak::pak("katilingban/pakete") +``` + ## Usage ### Creating GitHub issues checklist template for CRAN submissions @@ -106,7 +113,7 @@ This will add a Zenodo badge to your README file in the block were badges are us ## Citation -If you find the `{pakete}` package useful please cite using the suggested citation provided by a call to the `citation()` function as follows: +If you use the `{pakete}` package in your work, please cite using the suggested citation provided by a call to the `citation()` function as follows: ```{r citation} citation("pakete") diff --git a/README.md b/README.md index df29c7f..ee5d128 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,10 @@ Currently, `{pakete}` includes functions for: 5. adding [Zenodo](https://zenodo.org/) DOI badge; and, 6. adding specific GitHub Actions such as test deployment of package - website to [Netlify](https://www.netlify.com/) and mirroring of - repository to [Codeberg](https://codeberg.org/). + website to [Netlify](https://www.netlify.com/), mirroring of + repository to [Codeberg](https://codeberg.org/), and [R + Universe](https://ropensci.org/blog/2026/01/03/r-universe-workflows/) + testing. ## Installation @@ -56,6 +58,15 @@ install.packages( ) ``` +You can also install `{pakete}` from +[GitHub](https://github.com/katilingban/pakete) using the `{pak}` +package with: + +``` r +if (!require("pak")) install.packages("pak") +pak::pak("katilingban/pakete") +``` + ## Usage ### Creating GitHub issues checklist template for CRAN submissions @@ -149,7 +160,7 @@ relation to the Zenodo release URL. ## Citation -If you find the `{pakete}` package useful please cite using the +If you use the `{pakete}` package in your work, please cite using the suggested citation provided by a call to the `citation()` function as follows: