diff --git a/.github/workflows/render-rmarkdown.yaml b/.github/workflows/render-rmarkdown.yaml new file mode 100644 index 00000000..325f3c1a --- /dev/null +++ b/.github/workflows/render-rmarkdown.yaml @@ -0,0 +1,48 @@ +# 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 + +# Controls when the action will run: for now dev and master +on: + push: + branches: [main, master, dev,test-for-gh] + +name: render-rmarkdown + +jobs: + render-rmarkdown: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + # Checks-out golem repo so the job can access it + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: r-lib/actions/setup-pandoc@v2 + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + # install linux packages + - name: install linux packages + run: sudo apt-get install -y libgit2-dev + # install CRAN packages used inside README.Rmd + - name: install required packages + run: Rscript -e 'install.packages("remotes");remotes::install_cran(c("rmarkdown", "covr", "gert", "knitr", "devtools"), repos = "https://packagemanager.posit.co/cran/__linux__/jammy/latest")' + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + # Render READEME.md using rmarkdown + - name: render README + run: Rscript -e 'rmarkdown::render("README.Rmd", output_format = "md_document")' + - name: Render Rmarkdown files and Commit Results + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add README.md + git commit -m "Re-build README.md" || echo "No changes to commit" + git push origin || echo "No changes to commit" diff --git a/README.Rmd b/README.Rmd index 65253ad5..fb36995a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,7 +17,25 @@ knitr::opts_chunk$set( -[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html) [![R-CMD-check](https://github.com/ThinkR-open/golem/workflows/R-CMD-check/badge.svg)](https://github.com/ThinkR-open/golem/actions) [![Coverage status](https://codecov.io/gh/ThinkR-open/golem/branch/master/graph/badge.svg)](https://codecov.io/github/ThinkR-open/golem?branch=master) [![CRAN status](https://www.r-pkg.org/badges/version/golem)](https://cran.r-project.org/package=golem) +```{r echo = FALSE} +name_branch <- gert::git_branch() +link_to_branch_svg <- paste0( + "https://codecov.io/gh/ThinkR-open/golem/branch/", + name_branch, + "/graph/badge.svg" + ) +link_to_branch_html <- paste0( + "https://app.codecov.io/github/ThinkR-open/golem/tree/", + name_branch + ) +``` + +```{r, echo = FALSE, results = "asis"} +cat('[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)') +cat('[![R-CMD-check](https://github.com/ThinkR-open/golem/workflows/R-CMD-check/badge.svg)](https://github.com/ThinkR-open/golem/actions)') +cat(paste0("\n[![Coverage status](", link_to_branch_svg, ")](", link_to_branch_html, ")")) +cat('[![CRAN status](https://www.r-pkg.org/badges/version/golem)](https://cran.r-project.org/package=golem)') +``` @@ -115,7 +133,7 @@ Sys.time() Here are the test & coverage results: -```{r} +```{r error = TRUE} devtools::check(quiet = TRUE) ``` @@ -123,7 +141,7 @@ devtools::check(quiet = TRUE) unloadNamespace("golem") ``` -```{r} +```{r error = TRUE} covr::package_coverage() ``` diff --git a/README.md b/README.md index 22497fdd..1bec8440 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,10 @@ - [![Lifecycle: -stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html) -[![R-CMD-check](https://github.com/ThinkR-open/golem/workflows/R-CMD-check/badge.svg)](https://github.com/ThinkR-open/golem/actions) +stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)[![R-CMD-check](https://github.com/ThinkR-open/golem/workflows/R-CMD-check/badge.svg)](https://github.com/ThinkR-open/golem/actions) [![Coverage -status](https://codecov.io/gh/ThinkR-open/golem/branch/master/graph/badge.svg)](https://codecov.io/github/ThinkR-open/golem?branch=master) -[![CRAN +status](https://codecov.io/gh/ThinkR-open/golem/branch/test-for-gh/graph/badge.svg)](https://app.codecov.io/github/ThinkR-open/golem/tree/test-for-gh)[![CRAN status](https://www.r-pkg.org/badges/version/golem)](https://cran.r-project.org/package=golem) @@ -19,20 +16,20 @@ shiny applications. ## Installation -- You can install the stable version from CRAN with: +- You can install the stable version from CRAN with: + + + + install.packages("golem") -``` r -install.packages("golem") -``` +- You can install the development version from + [GitHub](https://github.com/Thinkr-open/golem) with: -- You can install the development version from - [GitHub](https://github.com/Thinkr-open/golem) with: + -``` r -# install.packages("remotes") -remotes::install_github("Thinkr-open/golem") # very close to CRAN version -# remotes::install_github("Thinkr-open/golem@dev") # if you like to play -``` + # install.packages("remotes") + remotes::install_github("Thinkr-open/golem") # very close to CRAN version + # remotes::install_github("Thinkr-open/golem@dev") # if you like to play ## Resources @@ -83,10 +80,10 @@ Vignette for a detailed walkthrough. This package is part of a series of tools for Shiny, which includes: -- `{golem}` - -- `{shinipsum}` - -- `{fakir}` - -- `{gemstones}` - +- `{golem}` - +- `{shinipsum}` - +- `{fakir}` - +- `{gemstones}` - ## Examples apps @@ -94,15 +91,15 @@ These are examples from the community. Please note that they may not necessarily be written in a canonical fashion and may have been written with different versions of `{golem}` or `{shiny}`. -- -- -- -- +- +- +- +- You can also find apps at: -- -- +- +- ## About @@ -110,76 +107,70 @@ You’re reading the doc about version: 0.4.20 This `README` has been compiled on the -``` r -Sys.time() -#> [1] "2024-02-28 15:40:51 CET" -``` + Sys.time() + #> [1] "2024-02-28 16:25:55 UTC" Here are the test & coverage results: -``` r -devtools::check(quiet = TRUE) -#> ℹ Loading golem -#> ── R CMD check results ─────────────────────────────────────── golem 0.4.20 ──── -#> Duration: 1m 11.6s -#> -#> 0 errors ✔ | 0 warnings ✔ | 0 notes ✔ -``` - -``` r -covr::package_coverage() -#> golem Coverage: 74.87% -#> R/add_dockerfiles_renv.R: 0.00% -#> R/add_dockerfiles.R: 0.00% -#> R/addins.R: 0.00% -#> R/bootstrap_attachment.R: 0.00% -#> R/bootstrap_dockerfiler.R: 0.00% -#> R/bootstrap_rstudio_api.R: 0.00% -#> R/enable_roxygenize.R: 0.00% -#> R/get_sysreqs.R: 0.00% -#> R/globals.R: 0.00% -#> R/sanity_check.R: 0.00% -#> R/with_opt.R: 9.68% -#> R/test_helpers.R: 30.26% -#> R/use_readme.R: 34.29% -#> R/js.R: 43.75% -#> R/reload.R: 45.36% -#> R/use_recommended.R: 54.55% -#> R/bootstrap_desc.R: 55.56% -#> R/install_dev_deps.R: 60.87% -#> R/bootstrap_usethis.R: 70.00% -#> R/add_r_files.R: 78.50% -#> R/modules_fn.R: 78.71% -#> R/utils.R: 79.78% -#> R/golem-yaml-set.R: 83.02% -#> R/use_utils.R: 83.33% -#> R/use_favicon.R: 85.56% -#> R/add_rstudio_files.R: 88.52% -#> R/add_resource_path.R: 88.89% -#> R/create_golem.R: 89.47% -#> R/make_dev.R: 90.00% -#> R/add_files.R: 91.96% -#> R/golem-yaml-get.R: 93.18% -#> R/run_dev.R: 95.65% -#> R/desc.R: 96.67% -#> R/boostrap_cli.R: 100.00% -#> R/boostrap_crayon.R: 100.00% -#> R/boostrap_fs.R: 100.00% -#> R/bootstrap_pkgload.R: 100.00% -#> R/bootstrap_roxygen2.R: 100.00% -#> R/browser_button.R: 100.00% -#> R/bundle_resources.R: 100.00% -#> R/config.R: 100.00% -#> R/disable_autoload.R: 100.00% -#> R/golem_welcome_page.R: 100.00% -#> R/golem-yaml-utils.R: 100.00% -#> R/is_golem.R: 100.00% -#> R/is_running.R: 100.00% -#> R/pkg_tools.R: 100.00% -#> R/set_golem_options.R: 100.00% -#> R/templates.R: 100.00% -#> R/use_files.R: 100.00% -``` + devtools::check(quiet = TRUE) + #> ℹ Loading golem + #> ── R CMD check results ─────────────────────────────────────── golem 0.4.20 ──── + #> Duration: 1m 11.1s + #> + #> 0 errors ✔ | 0 warnings ✔ | 0 notes ✔ + + covr::package_coverage() + #> golem Coverage: 85.38% + #> R/addins.R: 0.00% + #> R/bootstrap_rstudio_api.R: 0.00% + #> R/enable_roxygenize.R: 0.00% + #> R/get_sysreqs.R: 0.00% + #> R/sanity_check.R: 0.00% + #> R/test_helpers.R: 30.26% + #> R/js.R: 43.75% + #> R/reload.R: 45.36% + #> R/install_dev_deps.R: 60.87% + #> R/bootstrap_attachment.R: 61.54% + #> R/bootstrap_dockerfiler.R: 63.33% + #> R/bootstrap_desc.R: 66.67% + #> R/add_dockerfiles.R: 74.19% + #> R/add_r_files.R: 78.50% + #> R/bootstrap_usethis.R: 78.57% + #> R/modules_fn.R: 78.71% + #> R/use_recommended.R: 78.79% + #> R/golem-yaml-set.R: 83.02% + #> R/use_utils.R: 83.33% + #> R/utils.R: 83.75% + #> R/add_rstudio_files.R: 88.52% + #> R/add_resource_path.R: 88.89% + #> R/create_golem.R: 89.47% + #> R/make_dev.R: 90.00% + #> R/add_files.R: 91.96% + #> R/golem-yaml-get.R: 93.18% + #> R/add_dockerfiles_renv.R: 93.78% + #> R/run_dev.R: 95.65% + #> R/desc.R: 96.67% + #> R/use_favicon.R: 96.67% + #> R/boostrap_cli.R: 100.00% + #> R/boostrap_crayon.R: 100.00% + #> R/boostrap_fs.R: 100.00% + #> R/bootstrap_pkgload.R: 100.00% + #> R/bootstrap_roxygen2.R: 100.00% + #> R/browser_button.R: 100.00% + #> R/bundle_resources.R: 100.00% + #> R/config.R: 100.00% + #> R/disable_autoload.R: 100.00% + #> R/globals.R: 100.00% + #> R/golem_welcome_page.R: 100.00% + #> R/golem-yaml-utils.R: 100.00% + #> R/is_golem.R: 100.00% + #> R/is_running.R: 100.00% + #> R/pkg_tools.R: 100.00% + #> R/set_golem_options.R: 100.00% + #> R/templates.R: 100.00% + #> R/use_files.R: 100.00% + #> R/use_readme.R: 100.00% + #> R/with_opt.R: 100.00% ## CoC @@ -191,12 +182,10 @@ By participating in this project you agree to abide by its terms. Please style the files according to `grkstyle::grk_style_transformer()` -``` r -# If you work in RStudio -options(styler.addins_style_transformer = "grkstyle::grk_style_transformer()") + # If you work in RStudio + options(styler.addins_style_transformer = "grkstyle::grk_style_transformer()") -# If you work in VSCode -options(languageserver.formatting_style = function(options) { - grkstyle::grk_style_transformer() -}) -``` + # If you work in VSCode + options(languageserver.formatting_style = function(options) { + grkstyle::grk_style_transformer() + })