Skip to content

Commit 9843fbd

Browse files
committed
update coverage workflow
1 parent b55b172 commit 9843fbd

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

.github/workflows/cover.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ jobs:
2727
with:
2828
use-public-rspm: true
2929

30-
- name: Add r-universe to repos
31-
run: |
32-
cat("\noptions(repos=c(shikokuchuo='https://shikokuchuo.r-universe.dev',CRAN ='https://cloud.r-project.org'))\n", file = "~/.Rprofile", append = TRUE)
33-
shell: Rscript {0}
34-
3530
- uses: r-lib/actions/setup-r-dependencies@v2
3631
with:
3732
extra-packages: any::covr, any::arrow
@@ -48,23 +43,33 @@ jobs:
4843

4944
- name: Test coverage
5045
run: |
51-
covr::codecov(
46+
cov <- covr::package_coverage(
5247
quiet = FALSE,
5348
clean = FALSE,
54-
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
49+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
5550
)
51+
covr::to_cobertura(cov)
5652
shell: Rscript {0}
5753

54+
- uses: codecov/codecov-action@v4
55+
with:
56+
# Fail if error if not on PR, or if on PR and token is given
57+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
58+
file: ./cobertura.xml
59+
plugin: noop
60+
disable_search: true
61+
token: ${{ secrets.CODECOV_TOKEN }}
62+
5863
- name: Show testthat output
5964
if: always()
6065
run: |
6166
## --------------------------------------------------------------------
62-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
67+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
6368
shell: bash
6469

6570
- name: Upload test results
6671
if: failure()
67-
uses: actions/upload-artifact@v3
72+
uses: actions/upload-artifact@v4
6873
with:
6974
name: coverage-test-failures
7075
path: ${{ runner.temp }}/package

0 commit comments

Comments
 (0)