File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed
Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ on : [push]
2+
3+ name : test-coverage.yaml
4+
5+ permissions : read-all
6+
7+ jobs :
8+ test-coverage :
9+ runs-on : ubuntu-latest
10+ env :
11+ GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
12+
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - name : Assert CODECOV_TOKEN is set
17+ run : |
18+ if [[ -z "${{secrets.CODECOV_TOKEN}}" ]]; then
19+ >&2 echo "::error::ERROR: 'secrets.CODECOV_TOKEN' not set"
20+ exit 1
21+ fi
22+
23+ - uses : r-lib/actions/setup-r@v2
24+ with :
25+ use-public-rspm : true
26+
27+ - uses : r-lib/actions/setup-r-dependencies@v2
28+ with :
29+ extra-packages : |
30+ any::covr
31+ any::xml2
32+ any::remotes
33+ needs : coverage
34+
35+ - name : Install package itself (special case)
36+ run : |
37+ install.packages(".", repos = NULL, type = "source")
38+ shell : Rscript {0}
39+
40+ - name : Test coverage
41+ run : |
42+ cov <- covr::package_coverage(
43+ quiet = FALSE,
44+ clean = FALSE,
45+ install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
46+ )
47+ print(cov)
48+ covr::to_cobertura(cov)
49+ shell : Rscript {0}
50+
51+ - uses : codecov/codecov-action@v4
52+ with :
53+ fail_ci_if_error : ${{ github.event_name != 'pull_request' && true || false }}
54+ file : ./cobertura.xml
55+ plugin : noop
56+ disable_search : true
57+ token : ${{ secrets.CODECOV_TOKEN }}
58+
59+ - name : Upload test results
60+ if : failure()
61+ uses : actions/upload-artifact@v4
62+ with :
63+ name : coverage-test-failures
64+ path : ${{ runner.temp }}/package
You can’t perform that action at this time.
0 commit comments