Skip to content

Commit 2a3dd94

Browse files
committed
Switching coverage to coveralls
1 parent 97a2470 commit 2a3dd94

File tree

3 files changed

+27
-38
lines changed

3 files changed

+27
-38
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
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
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
55
branches: [main, master]
66
pull_request:
77
branches: [main, master]
88

9-
name: test-coverage.yaml
10-
11-
permissions: read-all
9+
name: test-coverage
1210

1311
jobs:
1412
test-coverage:
1513
runs-on: ubuntu-latest
1614
env:
1715
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
COVERALLS_TOKEN: ${{ secrets.COVERALLS_API }}
17+
CI_BRANCH: "main"
1818

1919
steps:
2020
- uses: actions/checkout@v4
@@ -25,37 +25,27 @@ jobs:
2525

2626
- uses: r-lib/actions/setup-r-dependencies@v2
2727
with:
28-
extra-packages: any::covr, any::xml2
29-
needs: coverage
28+
extra-packages: covr
3029

31-
- name: Test coverage
30+
- name: Enable Repo on Coveralls
31+
id: enable_coveralls
3232
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
5141
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}

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ knitr::opts_chunk$set(
2424
[![](http://cranlogs.r-pkg.org/badges/grand-total/bayesRecon)](https://cran.r-project.org/package=bayesRecon)
2525
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
2626
[![License: LGPL (>= 3)](https://img.shields.io/badge/license-LGPL (>= 3)-yellow.svg)](https://www.gnu.org/licences/lgpl-3.0)
27-
[![Codecov test coverage](https://codecov.io/gh/IDSIA/bayesRecon/graph/badge.svg)](https://app.codecov.io/gh/IDSIA/bayesRecon)
27+
[![coverage](https://coveralls.io/repos/github/IDSIA/bayesRecon/badge.svg)](https://coveralls.io/r/IDSIA/bayesRecon?branch=main)
2828
<!-- badges: end -->
2929

3030
The package `bayesRecon` implements several methods for probabilistic reconciliation of hierarchical time series forecasts.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ status](https://www.r-pkg.org/badges/version/bayesRecon)](https://CRAN.R-project
1616
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
1717
[![License: LGPL (\>=
1818
3)](https://img.shields.io/badge/license-LGPL%20(%3E=%203)-yellow.svg)](https://www.gnu.org/licences/lgpl-3.0)
19-
[![Codecov test
20-
coverage](https://codecov.io/gh/IDSIA/bayesRecon/graph/badge.svg)](https://app.codecov.io/gh/IDSIA/bayesRecon)
19+
[![coverage](https://coveralls.io/repos/github/IDSIA/bayesRecon/badge.svg)](https://coveralls.io/r/IDSIA/bayesRecon?branch=main)
2120
<!-- badges: end -->
2221

2322
The package `bayesRecon` implements several methods for probabilistic

0 commit comments

Comments
 (0)