Skip to content

Commit 165efe8

Browse files
authored
Merge pull request #130 from pharmaverse/121-install-test-coverage-bot
Closes #121 Add code coverage bot
2 parents 832f6bc + 67fa558 commit 165efe8

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/test-coverage.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
push:
55
branches: [main, master]
66
pull_request:
7-
branches: [main, master]
87

9-
name: test-coverage
8+
name: test-coverage.yaml
9+
10+
permissions: read-all
1011

1112
jobs:
1213
test-coverage:
@@ -23,18 +24,29 @@ jobs:
2324

2425
- uses: r-lib/actions/setup-r-dependencies@v2
2526
with:
26-
extra-packages: any::covr
27+
extra-packages: any::covr, any::xml2
2728
needs: coverage
2829

2930
- name: Test coverage
3031
run: |
31-
covr::codecov(
32+
cov <- covr::package_coverage(
3233
quiet = FALSE,
3334
clean = FALSE,
3435
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3536
)
37+
print(cov)
38+
covr::to_cobertura(cov)
3639
shell: Rscript {0}
3740

41+
- uses: codecov/codecov-action@v5
42+
with:
43+
# Fail if error if not on PR, or if on PR and token is given
44+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
45+
files: ./cobertura.xml
46+
plugins: noop
47+
disable_search: true
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
3850
- name: Show testthat output
3951
if: always()
4052
run: |

README.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ knitr::opts_chunk$set(
1919

2020
[<img src="http://pharmaverse.org/shields/metatools.svg"/>](https://pharmaverse.org) [![R-CMD-check](https://github.com/pharmaverse/metatools/workflows/R-CMD-check/badge.svg)](https://github.com/pharmaverse/metatools/actions) [![codecov](https://codecov.io/gh/pharmaverse/metatools/branch/main/graph/badge.svg?token=55N5APFLPA)](https://app.codecov.io/gh/pharmaverse/metatools) [<img src="https://img.shields.io/badge/License-MIT-blue.svg"/>](https://github.com/pharmaverse/metatools/blob/main/LICENSE) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
2121
[![R-CMD-check](https://github.com/pharmaverse/metatools/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pharmaverse/metatools/actions/workflows/R-CMD-check.yaml)
22+
[![Codecov test coverage](https://codecov.io/gh/pharmaverse/metatools/graph/badge.svg)](https://app.codecov.io/gh/pharmaverse/metatools)
2223
<!-- badges: end -->
2324

2425
The goal of metatools is to enable the use of metacore objects. Metatools can be used to build datasets or enhance columns in existing datasets as well as checking datasets against the metadata in metacore.

0 commit comments

Comments
 (0)