1
- # Workflow derived from https://github.com/r-lib/actions/tree/v2 /examples
1
+ # Workflow derived from https://github.com/r-lib/actions/tree/master /examples
2
2
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3
3
on :
4
4
push :
5
5
branches : [main, master]
6
6
pull_request :
7
7
branches : [main, master]
8
8
9
- name : test-coverage.yaml
10
-
11
- permissions : read-all
9
+ name : test-coverage
12
10
13
11
jobs :
14
12
test-coverage :
15
13
runs-on : ubuntu-latest
16
14
env :
17
15
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
16
+ COVERALLS_TOKEN : ${{ secrets.COVERALLS_API }}
17
+ CI_BRANCH : " main"
18
18
19
19
steps :
20
20
- uses : actions/checkout@v4
@@ -25,37 +25,27 @@ jobs:
25
25
26
26
- uses : r-lib/actions/setup-r-dependencies@v2
27
27
with :
28
- extra-packages : any::covr, any::xml2
29
- needs : coverage
28
+ extra-packages : covr
30
29
31
- - name : Test coverage
30
+ - name : Enable Repo on Coveralls
31
+ id : enable_coveralls
32
32
run : |
33
- cov <- covr::package_coverage(
34
- quiet = FALSE,
35
- clean = FALSE,
36
- install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
37
- )
38
- covr::to_cobertura(cov)
39
- shell : Rscript {0}
40
-
41
- - uses : codecov/codecov-action@v4
42
- with :
43
- fail_ci_if_error : ${{ github.event_name != 'pull_request' && true || false }}
44
- file : ./cobertura.xml
45
- plugin : noop
46
- disable_search : true
47
- token : ${{ secrets.CODECOV_TOKEN }}
48
-
49
- - name : Show testthat output
50
- if : always()
33
+ curl -s -H "Accept: application/json" \
34
+ -H "Content-Type: application/json" \
35
+ -H "Authorization: token $COVERALLS_TOKEN" \
36
+ -d '{"repo": {"service": "github","name": "'$GITHUB_REPOSITORY'"}}' \
37
+ -X POST https://coveralls.io/api/repos
38
+
39
+ - name : Get Coveralls Repo Token
40
+ id : get_coverall_repo_token
51
41
run : |
52
- ## --------------------------------------------------------------------
53
- find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
54
- shell : bash
55
-
56
- - name : Upload test results
57
- if : failure()
58
- uses : actions/upload-artifact@v4
59
- with :
60
- name : coverage-test-failures
61
- path : ${{ runner.temp }}/package
42
+ echo "COVERALLS_REPO_TOKEN=$(\
43
+ curl -s -H "Accept: application/json" \
44
+ -H "Content-Type: application/json" \
45
+ -H "Authorization: token $COVERALLS_TOKEN" \
46
+ https://coveralls.io/api/repos/github/$GITHUB_REPOSITORY \
47
+ | jq '.token')" >> $GITHUB_ENV
48
+
49
+ - name : Generate and Upload R Package Coverage
50
+ run : covr::coveralls(service_name='travis-pro', repo_token=${{ env.COVERALLS_REPO_TOKEN }}, type='all')
51
+ shell : Rscript {0}
0 commit comments