-
Notifications
You must be signed in to change notification settings - Fork 31
59 lines (51 loc) · 1.45 KB
/
test-coverage.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
on:
push:
paths:
- r-package/**
- .github/workflows/test-coverage.yaml
branches:
- dev
- master
pull_request:
paths:
- r-package/**
- .github/workflows/test-coverage.yaml
branches:
- dev
- master
name: test-coverage
jobs:
test-coverage:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
- name: Java setup
uses: actions/setup-java@v1
with:
java-version: '21'
java-package: jdk
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
needs: coverage
working-directory: r-package
- name: Test coverage
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}
working-directory: r-package
- uses: codecov/codecov-action@v4
with:
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
working-directory: r-package