Skip to content

Commit

Permalink
Add covr code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rsh52 committed Sep 26, 2022
1 parent 3959143 commit 5d25913
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
NOT_CRAN: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
REDCAP_URI: ${{ secrets.REDCAP_URI }}
SUPERHEROES_REDCAP_API: ${{ secrets.SUPERHEROES_REDCAP_API }}
REDCAPTIDIER_CLASSIC_API: ${{ secrets.REDCAPTIDIER_CLASSIC_API }}
REDCAPTIDIER_CLASSIC_NOREPEAT_API: ${{ secrets.REDCAPTIDIER_CLASSIC_NOREPEAT_API }}
REDCAPTIDIER_LONGITUDINAL_API: ${{ secrets.REDCAPTIDIER_LONGITUDINAL_API }}
REDCAPTIDIER_LONGITUDINAL_NOREPEAT_API: ${{ secrets.REDCAPTIDIER_LONGITUDINAL_NOREPEAT_API }}
REDCAPTIDIER_LONGITUDINAL_NOARMS_API: ${{ secrets.REDCAPTIDIER_LONGITUDINAL_NOARMS_API }}
R_KEEP_PKG_SOURCE: yes

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: any::covr
needs: coverage

- name: Test coverage
run: covr::codecov(quiet = FALSE)
shell: Rscript {0}
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ URL: https://github.com/CHOP-CGTDataOps/REDCapTidieR,
https://chop-cgtdataops.github.io/REDCapTidieR/
BugReports: https://github.com/CHOP-CGTDataOps/REDCapTidieR/issues
Suggests:
covr,
knitr,
rmarkdown,
testthat (>= 3.0.0)
Expand Down
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/CHOP-CGTDataOps/REDCapTidieR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/CHOP-CGTDataOps/REDCapTidieR/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/REDCapTidieR)](https://CRAN.R-project.org/package=REDCapTidieR)
[![](https://cranlogs.r-pkg.org/badges/grand-total/REDCapTidieR)](https://cran.r-project.org/package=REDCapTidieR)
[![Codecov test coverage](https://codecov.io/gh/CHOP-CGTDataOps/REDCapTidieR/branch/main/graph/badge.svg)](https://app.codecov.io/gh/CHOP-CGTDataOps/REDCapTidieR?branch=main)
<!-- badges: end -->

The {REDCapTidieR} package provides an elegant way to import data from a [REDCap](https://www.project-redcap.org/) database into an R environment. It builds upon the [{REDCapR}](https://ouhscbbmc.github.io/REDCapR/) package to query the REDCap API and then transforms the returned data into a set of tidy tibbles.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](h
[![CRAN
status](https://www.r-pkg.org/badges/version/REDCapTidieR)](https://CRAN.R-project.org/package=REDCapTidieR)
[![](https://cranlogs.r-pkg.org/badges/grand-total/REDCapTidieR)](https://cran.r-project.org/package=REDCapTidieR)
[![Codecov test
coverage](https://codecov.io/gh/CHOP-CGTDataOps/REDCapTidieR/branch/main/graph/badge.svg)](https://app.codecov.io/gh/CHOP-CGTDataOps/REDCapTidieR?branch=main)
<!-- badges: end -->

The {REDCapTidieR} package provides an elegant way to import data from a
Expand Down
14 changes: 14 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
threshold: 1%
informational: true

0 comments on commit 5d25913

Please sign in to comment.