From 7759f858f26912d71da71de758dfa80ec6cb9c85 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 + codecov.yml | 9 ++++++++ 5 files changed, 47 insertions(+), 1 deletion(-) 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/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