44push :
55branches :[main, master]
66pull_request :
7- branches :[main, master]
87
9- name :test-coverage
8+ name :test-coverage.yaml
9+
10+ permissions :read-all
1011
1112jobs :
1213test-coverage :
@@ -15,36 +16,47 @@ jobs:
1516GITHUB_PAT :${{ secrets.GITHUB_TOKEN }}
1617
1718steps :
18- -uses :actions/checkout@v3
19+ -uses :actions/checkout@v4
1920
2021 -uses :r-lib/actions/setup-r@v2
2122with :
2223use-public-rspm :true
2324
2425 -uses :r-lib/actions/setup-r-dependencies@v2
2526with :
26- extra-packages :any::covr
27+ extra-packages :any::covr, any::xml2
2728needs :coverage
2829
2930 -name :Test coverage
3031run :|
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 )
37+ print(cov)
38+ covr::to_cobertura(cov)
3639shell :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
3951if :always()
4052run :|
4153 ## --------------------------------------------------------------------
42- find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; ||true
54+ find' ${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; ||true
4355shell :bash
4456
4557 -name :Upload test results
4658if :failure()
47- uses :actions/upload-artifact@v3
59+ uses :actions/upload-artifact@v4
4860with :
4961name :coverage-test-failures
5062path :${{ runner.temp }}/package