Skip to content

Commit 2f97e98

Browse files
committed
test coverage workflow
1 parent f7abff1 commit 2f97e98

File tree

1 file changed

+6
-36
lines changed

1 file changed

+6
-36
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches: [main, master]
5+
branches: [main]
66
pull_request:
7-
branches: [main, master]
7+
branches: [main]
88

99
name: test-coverage
1010

11-
permissions: read-all
12-
1311
jobs:
1412
test-coverage:
15-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1614
env:
1715
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1816

@@ -25,45 +23,17 @@ jobs:
2523

2624
- uses: r-lib/actions/setup-r-dependencies@v2
2725
with:
28-
extra-packages: any::covr, any::xml2
26+
extra-packages: any::covr
2927
needs: coverage
3028

3129
- name: Install cpp4rtest
3230
run: |
3331
options(warn = 2)
32+
pak::pkg_install("pachadotdev/cpp4r", dependencies = TRUE)
3433
pak::local_install_dev_deps("cpp4rtest", dependencies = TRUE)
35-
install.packages(".", repos = NULL, type = "source")
3634
install.packages("cpp4rtest", repos = NULL, INSTALL_opts = "--install-tests", type = "source")
3735
shell: Rscript {0}
3836

3937
- name: Test coverage
40-
run: |
41-
cov <- covr::package_coverage(
42-
quiet = FALSE,
43-
clean = FALSE,
44-
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
45-
)
46-
covr::to_cobertura(cov)
38+
run: covr::codecov(quiet = FALSE)
4739
shell: Rscript {0}
48-
49-
- uses: codecov/codecov-action@v4
50-
with:
51-
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
52-
file: ./cobertura.xml
53-
plugin: noop
54-
disable_search: true
55-
token: ${{ secrets.CODECOV_TOKEN }}
56-
57-
- name: Show testthat output
58-
if: always()
59-
run: |
60-
## --------------------------------------------------------------------
61-
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
62-
shell: bash
63-
64-
- name: Upload test results
65-
if: failure()
66-
uses: actions/upload-artifact@v4
67-
with:
68-
name: coverage-test-failures
69-
path: ${{ runner.temp }}/package

0 commit comments

Comments
 (0)