Skip to content

Commit dc56124

Browse files
committed
Update code coverage version
1 parent 7e9580d commit dc56124

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 20 additions & 8 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:
@@ -15,41 +16,52 @@ jobs:
1516
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1617

1718
steps:
18-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1920

2021
- uses: r-lib/actions/setup-r@v2
2122
with:
2223
use-public-rspm: true
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,
34-
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package"),
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package"),
3536
function_exclusions = c(
3637
"kernelshap\\.ranger",
3738
"permshap\\.ranger",
3839
"pred_ranger"
3940
)
4041
)
42+
print(cov)
43+
covr::to_cobertura(cov)
4144
shell: Rscript {0}
4245

46+
- uses: codecov/codecov-action@v5
47+
with:
48+
# Fail if error if not on PR, or if on PR and token is given
49+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
50+
files: ./cobertura.xml
51+
plugins: noop
52+
disable_search: true
53+
token: ${{ secrets.CODECOV_TOKEN }}
54+
4355
- name: Show testthat output
4456
if: always()
4557
run: |
4658
## --------------------------------------------------------------------
47-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
59+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
4860
shell: bash
4961

5062
- name: Upload test results
5163
if: failure()
52-
uses: actions/upload-artifact@v3
64+
uses: actions/upload-artifact@v4
5365
with:
5466
name: coverage-test-failures
5567
path: ${{ runner.temp }}/package

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
- More compact README.
66
- Updated function description.
77

8+
## Maintenance
9+
10+
- Update code coverage version [#150](https://github.com/ModelOriented/kernelshap/pull/150).
11+
812
# kernelshap 0.7.0
913

1014
This release is intended to be the last before stable version 1.0.0.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- badges: start -->
44

55
[![R-CMD-check](https://github.com/ModelOriented/kernelshap/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ModelOriented/kernelshap/actions/workflows/R-CMD-check.yaml)
6-
[![Codecov test coverage](https://codecov.io/gh/ModelOriented/kernelshap/graph/badge.svg)](https://app.codecov.io/gh/ModelOriented/kernelshap?branch=main)
6+
[![Codecov test coverage](https://codecov.io/gh/ModelOriented/kernelshap/graph/badge.svg)](https://app.codecov.io/gh/ModelOriented/kernelshap)
77
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/kernelshap)](https://cran.r-project.org/package=kernelshap)
88

99
[![](https://cranlogs.r-pkg.org/badges/kernelshap)](https://cran.r-project.org/package=kernelshap)

0 commit comments

Comments
 (0)