From 2e2134cc36389e005f1626528a34111d037dfb8f Mon Sep 17 00:00:00 2001 From: Tan-DESKPC Date: Tue, 11 Jan 2022 21:33:48 -0500 Subject: [PATCH] add codecov --- .Rbuildignore | 1 + .github/workflows/test-coverage.yaml | 30 ++++++++++++++++++++++++++++ DESCRIPTION | 3 ++- README.Rmd | 1 + README.md | 2 ++ codecov.yml | 14 +++++++++++++ 6 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test-coverage.yaml create mode 100644 codecov.yml diff --git a/.Rbuildignore b/.Rbuildignore index 044e7e5..132086a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -11,3 +11,4 @@ ^update$ ^modelling$ ^models$ +^codecov\.yml$ diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..3c0da1c --- /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 0b40042..1628342 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,7 +40,8 @@ Suggests: roxygen2 (>= 7.1.0), testthat (>= 3.0.0), piggyback (>= 0.1.1), - arrow (>= 5.0.0) + arrow (>= 5.0.0), + covr Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) diff --git a/README.Rmd b/README.Rmd index 4772fe0..cb3d3c4 100644 --- a/README.Rmd +++ b/README.Rmd @@ -27,6 +27,7 @@ options(tibble.max_extra_cols = 20, experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg?style=flat-square)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![Dev status](https://img.shields.io/github/r-package/v/ffverse/ffopportunity/main?label=dev&style=flat-square&logo=github)](https://ffopportunity.ffverse.com/) +[![Codecov test coverage](https://img.shields.io/codecov/c/github/ffverse/ffopportunity?label=codecov&style=flat-square&logo=codecov)](https://app.codecov.io/gh/ffverse/ffopportunity?branch=main) [![nflverse discord](https://img.shields.io/discord/789805604076126219?color=7289da&label=nflverse%20discord&logo=discord&logoColor=fff&style=flat-square)](https://discord.com/invite/5Er2FBnnQa) diff --git a/README.md b/README.md index 026a6ce..fb8f2b3 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ status](https://img.shields.io/cran/v/ffopportunity?style=flat-square&logo=R&lab experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg?style=flat-square)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![Dev status](https://img.shields.io/github/r-package/v/ffverse/ffopportunity/main?label=dev&style=flat-square&logo=github)](https://ffopportunity.ffverse.com/) +[![Codecov test +coverage](https://img.shields.io/codecov/c/github/ffverse/ffopportunity?label=codecov&style=flat-square&logo=codecov)](https://app.codecov.io/gh/ffverse/ffopportunity?branch=main) [![nflverse discord](https://img.shields.io/discord/789805604076126219?color=7289da&label=nflverse%20discord&logo=discord&logoColor=fff&style=flat-square)](https://discord.com/invite/5Er2FBnnQa) 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