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