Skip to content

Commit 4407a55

Browse files
committed
attempting to fix test coverage reporting via actions
1 parent 08abbd7 commit 4407a55

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,35 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v3
19-
- uses: r-lib/actions/setup-r@v2-branch
19+
20+
- uses: r-lib/actions/setup-r@v2
2021
with:
2122
use-public-rspm: true
2223

23-
- uses: r-lib/actions/setup-r-dependencies@v2-branch
24+
- uses: r-lib/actions/setup-r-dependencies@v2
2425
with:
2526
extra-packages: any::covr
2627
needs: coverage
2728

2829
- name: Test coverage
2930
run: |
30-
test1 <- covr::package_coverage()
31-
system("mv tests/testthat tests/done")
32-
system("mv tests/local tests/testthat")
33-
test2 <- covr::package_coverage()
34-
system("mv tests/testthat tests/local")
35-
system("mv tests/done tests/testthat")
36-
combined_cov <- c(test1, test2)
37-
attr(combined_cov, "class") <- attr(test1, "class")
38-
attr(combined_cov, "package") <- attr(test1, "package")
39-
attr(combined_cov, "relative") <- attr(test1, "relative")
40-
covr::codecov(coverage = combined_cov, quiet = FALSE)
31+
covr::codecov(
32+
quiet = FALSE,
33+
clean = FALSE,
34+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
35+
)
4136
shell: Rscript {0}
37+
38+
- name: Show testthat output
39+
if: always()
40+
run: |
41+
## --------------------------------------------------------------------
42+
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
43+
shell: bash
44+
45+
- name: Upload test results
46+
if: failure()
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: coverage-test-failures
50+
path: ${{ runner.temp }}/package

0 commit comments

Comments
 (0)