From 41a7fc40f819e663d3b4479ccef9ed0c66f07e3e Mon Sep 17 00:00:00 2001 From: Jan Marvin Garbuszus Date: Sun, 8 Jan 2023 15:29:24 +0100 Subject: [PATCH] add codecov --- .Rbuildignore | 1 + .github/workflows/test-coverage.yaml | 31 ++++++++++++++++++++++++++++ DESCRIPTION | 6 +++++- README.Rmd | 1 + README.md | 4 +++- codecov.yml | 9 ++++++++ 6 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-coverage.yaml create mode 100644 codecov.yml diff --git a/.Rbuildignore b/.Rbuildignore index de64411..56013e2 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,3 +3,4 @@ ^.*\.Rproj$ ^\.Rproj\.user$ ^.lintr$ +^codecov\.yml$ diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..fe87549 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,31 @@ +# 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: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v3 + + - 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} diff --git a/DESCRIPTION b/DESCRIPTION index a7fc548..e60aa36 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,7 +14,11 @@ BugReports: https://github.com/JanMarvin/readsas/issues Depends: R (>= 3.4.0) Imports: Rcpp, stringi LinkingTo: Rcpp -Suggests: testthat, foreign, datasets +Suggests: + testthat, + foreign, + datasets, + covr Encoding: UTF-8 Language: en-US RoxygenNote: 7.2.3 diff --git a/README.Rmd b/README.Rmd index 764eca8..96ce1e4 100644 --- a/README.Rmd +++ b/README.Rmd @@ -14,6 +14,7 @@ library(readsas) # readsas ![R-CMD-check](https://github.com/JanMarvin/readspss/workflows/R-CMD-check/badge.svg) +[![Codecov test coverage](https://codecov.io/gh/JanMarvin/readsas/branch/main/graph/badge.svg)](https://app.codecov.io/gh/JanMarvin/readsas?branch=main) R package using Rcpp to parse a SAS file into a data.frame(). Currently diff --git a/README.md b/README.md index e59bb9f..a18d686 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ ![R-CMD-check](https://github.com/JanMarvin/readspss/workflows/R-CMD-check/badge.svg) +[![Codecov test +coverage](https://codecov.io/gh/JanMarvin/readsas/branch/main/graph/badge.svg)](https://app.codecov.io/gh/JanMarvin/readsas?branch=main) R package using Rcpp to parse a SAS file into a data.frame(). Currently @@ -11,7 +13,7 @@ R package using Rcpp to parse a SAS file into a data.frame(). Currently The package allows (experimental) reading of sas7bdat files that are -- (un)compressed +- (un)compressed As with other releases of the `read` series, focus is again on being as accurate as possible. Speed is welcome, but a secondary goal. diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..86d3ea1 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,9 @@ +codecov: + token: 6ada052e-d99a-4f68-af1f-813f426e00ad + +comment: no # do not comment PR with the result + +coverage: + status: + project: false + patch: false