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