diff --git a/.Rbuildignore b/.Rbuildignore index ca584cf..d9bb52d 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,4 @@ ^README.Rmd$ ^README.md$ ^\.github$ +^codecov\.yml$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 1ab118b..a2d2629 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -29,3 +29,27 @@ jobs: needs: check - uses: r-lib/actions/check-r-package@v2 + + - name: Test coverage + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + ) + shell: Rscript {0} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v3 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package + diff --git a/README.Rmd b/README.Rmd index 8bf0123..b89744e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -9,6 +9,7 @@ editor_options: [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-green.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) [![R-CMD-check](https://github.com/PolMine/duplicates/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/PolMine/duplicates/actions/workflows/R-CMD-check.yaml) +[![Codecov test coverage](https://codecov.io/gh/PolMine/duplicates/branch/devel/graph/badge.svg)](https://app.codecov.io/gh/PolMine/duplicates?branch=devel) diff --git a/README.md b/README.md index 11e025d..4c43d80 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ v3](https://img.shields.io/badge/License-GPLv3-green.svg)](https://www.gnu.org/l [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) [![R-CMD-check](https://github.com/PolMine/duplicates/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/PolMine/duplicates/actions/workflows/R-CMD-check.yaml) +[![Codecov test +coverage](https://codecov.io/gh/PolMine/duplicates/branch/devel/graph/badge.svg)](https://app.codecov.io/gh/PolMine/duplicates?branch=devel) ## About 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