From 87f15e6793ba6cb9e5c82b8fe00c8c725506e6ea Mon Sep 17 00:00:00 2001 From: hanneoberman Date: Tue, 15 Mar 2022 12:27:05 +0100 Subject: [PATCH] Check test coverage --- .Rbuildignore | 1 + .github/workflows/test-coverage.yaml | 30 ++++++++++++++++++++++++++++ DESCRIPTION | 6 +++--- README.Rmd | 1 + README.md | 2 ++ codecov.yml | 14 +++++++++++++ 6 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test-coverage.yaml create mode 100644 codecov.yml diff --git a/.Rbuildignore b/.Rbuildignore index 8986771a..4c0c4ba8 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -10,3 +10,4 @@ ^pkgdown$ ^CODE_OF_CONDUCT\.md$ ^CRAN_COMMENTS\.md$ +^codecov\.yml$ diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 00000000..3c0da1c9 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,30 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: test-coverage + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v1 + with: + extra-packages: covr + + - name: Test coverage + run: covr::codecov() + shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index fb44d67a..3879e314 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,16 +26,16 @@ Imports: stats, stringr, tidyr, - tidyselect, utils Suggests: testthat (>= 3.0.0), plotly, knitr, - rmarkdown + rmarkdown, + covr URL: https://github.com/amices/ggmice, https://amices.org/, - http://amices.org/ggmice/ + https://amices.org/ggmice/ BugReports: https://github.com/amices/ggmice Config/testthat/edition: 3 VignetteBuilder: knitr diff --git a/README.Rmd b/README.Rmd index 53de5e3b..7f2e6841 100644 --- a/README.Rmd +++ b/README.Rmd @@ -21,6 +21,7 @@ set.seed(1) [![GitHub R package version](https://img.shields.io/github/r-package/v/amices/ggmice.svg)](https://github.com/amices/ggmice/blob/main/DESCRIPTION) [![GitHub](https://img.shields.io/github/license/amices/ggmice.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) +[![Codecov test coverage](https://codecov.io/gh/amices/ggmice/branch/main/graph/badge.svg)](https://app.codecov.io/gh/amices/ggmice?branch=main) ## Plotting package for incomplete and imputed data diff --git a/README.md b/README.md index 92578fbe..c923833a 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ version](https://img.shields.io/github/r-package/v/amices/ggmice.svg)](https://g [![GitHub](https://img.shields.io/github/license/amices/ggmice.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) +[![Codecov test +coverage](https://codecov.io/gh/amices/ggmice/branch/main/graph/badge.svg)](https://app.codecov.io/gh/amices/ggmice?branch=main) ## Plotting package for incomplete and imputed data diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..04c55859 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +comment: false + +coverage: + status: + project: + default: + target: auto + threshold: 1% + informational: true + patch: + default: + target: auto + threshold: 1% + informational: true