diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index d154546..7dbc925 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -33,6 +33,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} R_KEEP_PKG_SOURCE: yes _R_CHECK_FORCE_SUGGESTS_: false _R_CHECK_RD_XREFS_: false @@ -72,6 +73,13 @@ jobs: R CMD build litedown R CMD check --as-cran --no-manual litedown_*.tar.gz + - name: Test coverage + if: success() && runner.os == 'Linux' && matrix.config.r == 'release' + run: | + pak::pkg_install('covr') + covr::codecov() + shell: Rscript {0} + - uses: actions/checkout@HEAD if: runner.os == 'macOS' with: diff --git a/README.md b/README.md index 697dcdf..ce7b258 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ release](https://www.r-pkg.org/badges/version/litedown)](https://cran.r-project.org/package=litedown) [![litedown on r-universe](https://yihui.r-universe.dev/badges/litedown)](https://yihui.r-universe.dev/litedown) +[![Codecov test +coverage](https://codecov.io/gh/yihui/litedown/branch/main/graph/badge.svg)](https://app.codecov.io/gh/yihui/litedown?branch=main)