Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: use test coverage for current git-branch #1133

Merged
merged 12 commits into from
Feb 28, 2024
48 changes: 48 additions & 0 deletions .github/workflows/render-rmarkdown.yaml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
git add README.md
git commit -m "Re-build README.md" || echo "No changes to commit"
git push origin || echo "No changes to commit"
24 changes: 21 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,25 @@ knitr::opts_chunk$set(

<!-- badges: start -->

[![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)')
```

<!-- badges: end -->

Expand Down Expand Up @@ -115,15 +133,15 @@ Sys.time()

Here are the test & coverage results:

```{r}
```{r error = TRUE}
devtools::check(quiet = TRUE)
```

```{r echo = FALSE}
unloadNamespace("golem")
```

```{r}
```{r error = TRUE}
covr::package_coverage()
```

Expand Down
191 changes: 90 additions & 101 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- badges: start -->

[![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)

<!-- badges: end -->
Expand All @@ -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

Expand Down Expand Up @@ -83,103 +80,97 @@ Vignette for a detailed walkthrough.

This package is part of a series of tools for Shiny, which includes:

- `{golem}` - <https://github.com/ThinkR-open/golem>
- `{shinipsum}` - <https://github.com/ThinkR-open/shinipsum>
- `{fakir}` - <https://github.com/ThinkR-open/fakir>
- `{gemstones}` - <https://github.com/ThinkR-open/gemstones>
- `{golem}` - <https://github.com/ThinkR-open/golem>
- `{shinipsum}` - <https://github.com/ThinkR-open/shinipsum>
- `{fakir}` - <https://github.com/ThinkR-open/fakir>
- `{gemstones}` - <https://github.com/ThinkR-open/gemstones>

## Examples apps

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}`.

- <https://github.com/seanhardison1/vcrshiny>
- <https://github.com/Nottingham-and-Nottinghamshire-ICS/healthcareSPC>
- <https://github.com/marton-balazs-kovacs/tenzing>
- <https://github.com/shahreyar-abeer/cranstars>
- <https://github.com/seanhardison1/vcrshiny>
- <https://github.com/Nottingham-and-Nottinghamshire-ICS/healthcareSPC>
- <https://github.com/marton-balazs-kovacs/tenzing>
- <https://github.com/shahreyar-abeer/cranstars>

You can also find apps at:

- <https://connect.thinkr.fr/connect/>
- <https://github.com/ColinFay/golemexamples>
- <https://connect.thinkr.fr/connect/>
- <https://github.com/ColinFay/golemexamples>

## About

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

Expand All @@ -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()
})
Loading