From 7fe432c008512506c70916e9150cb0c026b0ce80 Mon Sep 17 00:00:00 2001 From: Florian Rupprecht Date: Mon, 28 Feb 2022 23:54:46 +0100 Subject: [PATCH] CI code coverage --- .Rbuildignore | 1 + .github/workflows/test-coverage.yaml | 30 ++++++++++++++++++++++++++++ DESCRIPTION | 3 ++- README.md | 3 ++- codecov.yml | 14 +++++++++++++ 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-coverage.yaml create mode 100644 codecov.yml diff --git a/.Rbuildignore b/.Rbuildignore index 6bceda2..1a12817 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -20,3 +20,4 @@ ^_pkgdown\.yml$ ^pkgdown$ ^CRAN-SUBMISSION$ +^codecov\.yml$ diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..4b01af7 --- /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@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: covr + + - name: Test coverage + run: covr::codecov() + shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index d1c1c48..08e3b7d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -41,7 +41,8 @@ Suggests: xml2 (>= 1.0.0), fontquiver (>= 0.2.0), knitr, - rmarkdown + rmarkdown, + covr Roxygen: list(markdown = TRUE) RoxygenNote: 7.1.2 Encoding: UTF-8 diff --git a/README.md b/README.md index b945bd1..e9f3399 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![R-CMD-check](https://github.com/nx10/httpgd/workflows/R-CMD-check/badge.svg)](https://github.com/nx10/httpgd/actions) [![CRAN](https://www.r-pkg.org/badges/version/httpgd)](https://CRAN.R-project.org/package=httpgd) ![downloads](https://cranlogs.r-pkg.org/badges/grand-total/httpgd) +[![Codecov test coverage](https://codecov.io/gh/nx10/httpgd/branch/master/graph/badge.svg)](https://app.codecov.io/gh/nx10/httpgd?branch=master) A graphics device for R that is accessible via network protocols. @@ -86,4 +87,4 @@ This project is licensed GPL v2.0. It includes parts of [`svglite`]() (GPL ≥ 2), [`Belle`](https://github.com/octobanana/belle) (MIT) and [`fmt`](https://github.com/fmtlib/fmt) (MIT). The HTML client includes [Material Design icons by Google](https://github.com/google/material-design-icons) which are licensed under the [Apache License Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt). -Full copies of the license agreements used by these components are included in [`./inst/licenses`](https://github.com/nx10/httpgd/tree/master/inst/licenses). \ No newline at end of file +Full copies of the license agreements used by these components are included in [`./inst/licenses`](https://github.com/nx10/httpgd/tree/master/inst/licenses). diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..04c5585 --- /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