4
4
push :
5
5
branches : [main, master]
6
6
pull_request :
7
- branches : [main, master, patch-for-cran]
8
7
9
- name : test-coverage
8
+ name : test-coverage.yaml
9
+
10
+ permissions : read-all
10
11
11
12
jobs :
12
13
test-coverage :
@@ -15,38 +16,46 @@ jobs:
15
16
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
16
17
17
18
steps :
18
- - uses : actions/checkout@v3
19
+ - uses : actions/checkout@v4
19
20
20
21
- uses : r-lib/actions/setup-r@v2
21
22
with :
22
23
use-public-rspm : true
23
24
24
25
- uses : r-lib/actions/setup-r-dependencies@v2
25
26
with :
26
- extra-packages : |
27
- any::covr
28
- any::vdiffr
27
+ extra-packages : any::covr, any::xml2, any::vdiffr
29
28
needs : coverage
30
29
31
30
- name : Test coverage
32
31
run : |
33
- covr::codecov (
32
+ cov <- covr::package_coverage (
34
33
quiet = FALSE,
35
34
clean = FALSE,
36
- install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
35
+ install_path = file.path(normalizePath( Sys.getenv("RUNNER_TEMP"), winslash = "/ "), "package")
37
36
)
37
+ covr::to_cobertura(cov)
38
38
shell : Rscript {0}
39
39
40
+ - uses : codecov/codecov-action@v4
41
+ with :
42
+ # Fail if error if not on PR, or if on PR and token is given
43
+ fail_ci_if_error : ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
44
+ file : ./cobertura.xml
45
+ plugin : noop
46
+ disable_search : true
47
+ token : ${{ secrets.CODECOV_TOKEN }}
48
+
40
49
- name : Show testthat output
41
50
if : always()
42
51
run : |
43
52
## --------------------------------------------------------------------
44
- find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
53
+ find ' ${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
45
54
shell : bash
46
55
47
56
- name : Upload test results
48
57
if : failure()
49
- uses : actions/upload-artifact@v3
58
+ uses : actions/upload-artifact@v4
50
59
with :
51
60
name : coverage-test-failures
52
61
path : ${{ runner.temp }}/package
0 commit comments