@@ -11,7 +11,7 @@ permissions: read-all
11
11
12
12
jobs :
13
13
test-coverage :
14
- runs-on : windows -latest
14
+ runs-on : ubuntu -latest
15
15
env :
16
16
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
17
17
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
@@ -33,19 +33,19 @@ jobs:
33
33
34
34
- name : Test coverage
35
35
run : |
36
- # Need to config junit on a tempdir() to locate it
36
+ # Need to config junit on working dir to locate it
37
37
wdir <- file.path(normalizePath(getwd(), winslash = "/"))
38
- junfile <- file.path(
39
- normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"),
40
- "junit.xml"
41
- )
38
+ junfile <- file.path(wdir, "junit.xml")
39
+
42
40
# And get the name
43
41
pkgname <- as.character(unname(read.dcf("DESCRIPTION", "Package")))
42
+
44
43
# Create junit code as character
45
44
junreport <- paste0(
46
45
"testthat::test_package('",
47
46
pkgname, "', reporter = testthat::JunitReporter$new(file = '", junfile, "'))"
48
47
)
48
+
49
49
cov <- covr::package_coverage(
50
50
quiet = FALSE,
51
51
clean = FALSE,
@@ -55,13 +55,12 @@ jobs:
55
55
), "package"),
56
56
code = junreport
57
57
)
58
+
58
59
# Show results
59
60
print(cov)
61
+
60
62
# Generate files for upload in the working dir
61
63
covr::to_cobertura(cov)
62
- file.copy(junfile, wdir, overwrite = TRUE)
63
- # And clean
64
- unlink(junfile, force = TRUE)
65
64
shell : Rscript {0}
66
65
67
66
- name : Upload coverage report
96
95
with :
97
96
name : coverage-test-failures
98
97
path : ${{ runner.temp }}/package
98
+
0 commit comments