Skip to content

Commit 3eaa888

Browse files
Update test-coverage.yaml to latest (#328)
1 parent 0dc5292 commit 3eaa888

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,60 @@ 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:
1314
runs-on: ubuntu-latest
14-
# accidentally committed an infinite loop that ran
15-
# for 6 hours in #208, so set a reasonable conservative upper bound.
16-
timeout-minutes: 40
1715
env:
1816
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1917

2018
steps:
21-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2220

2321
- uses: r-lib/actions/setup-r@v2
2422
with:
2523
use-public-rspm: true
2624

2725
- uses: r-lib/actions/setup-r-dependencies@v2
2826
with:
29-
extra-packages: any::covr
27+
extra-packages: any::covr, any::xml2
3028
needs: coverage
3129

3230
- name: Test coverage
3331
run: |
34-
covr::codecov(
32+
cov <- covr::package_coverage(
3533
quiet = FALSE,
3634
clean = FALSE,
37-
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3836
)
37+
print(cov)
38+
covr::to_cobertura(cov)
3939
shell: Rscript {0}
4040

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+
4150
- name: Show testthat output
4251
if: always()
4352
run: |
4453
## --------------------------------------------------------------------
45-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
54+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
4655
shell: bash
4756

4857
- name: Upload test results
4958
if: failure()
50-
uses: actions/upload-artifact@v3
59+
uses: actions/upload-artifact@v4
5160
with:
5261
name: coverage-test-failures
5362
path: ${{ runner.temp }}/package
63+

0 commit comments

Comments
 (0)