diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 9882260..8e69813 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: @@ -6,15 +6,15 @@ on: pull_request: branches: [main, master] -name: test-coverage.yaml - -permissions: read-all +name: test-coverage jobs: test-coverage: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_TOKEN: ${{ secrets.COVERALLS_API }} + CI_BRANCH: "main" steps: - uses: actions/checkout@v4 @@ -25,37 +25,27 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::covr, any::xml2 - needs: coverage + extra-packages: covr - - name: Test coverage + - name: Enable Repo on Coveralls + id: enable_coveralls 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} - - - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} - file: ./cobertura.xml - plugin: noop - disable_search: true - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Show testthat output - if: always() + curl -s -H "Accept: application/json" \ + -H "Content-Type: application/json" \ + -H "Authorization: token $COVERALLS_TOKEN" \ + -d '{"repo": {"service": "github","name": "'$GITHUB_REPOSITORY'"}}' \ + -X POST https://coveralls.io/api/repos + + - name: Get Coveralls Repo Token + id: get_coverall_repo_token run: | - ## -------------------------------------------------------------------- - find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload test results - if: failure() - uses: actions/upload-artifact@v4 - with: - name: coverage-test-failures - path: ${{ runner.temp }}/package + echo "COVERALLS_REPO_TOKEN=$(\ + curl -s -H "Accept: application/json" \ + -H "Content-Type: application/json" \ + -H "Authorization: token $COVERALLS_TOKEN" \ + https://coveralls.io/api/repos/github/$GITHUB_REPOSITORY \ + | jq '.token')" >> $GITHUB_ENV + + - name: Generate and Upload R Package Coverage + run: covr::coveralls(service_name='travis-pro', repo_token=${{ env.COVERALLS_REPO_TOKEN }}, type='all') + shell: Rscript {0} \ No newline at end of file diff --git a/README.Rmd b/README.Rmd index 2676225..e82ca01 100644 --- a/README.Rmd +++ b/README.Rmd @@ -24,7 +24,7 @@ knitr::opts_chunk$set( [![](http://cranlogs.r-pkg.org/badges/grand-total/bayesRecon)](https://cran.r-project.org/package=bayesRecon) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![License: LGPL (>= 3)](https://img.shields.io/badge/license-LGPL (>= 3)-yellow.svg)](https://www.gnu.org/licences/lgpl-3.0) -[![Codecov test coverage](https://codecov.io/gh/IDSIA/bayesRecon/graph/badge.svg)](https://app.codecov.io/gh/IDSIA/bayesRecon) +[![coverage](https://coveralls.io/repos/github/IDSIA/bayesRecon/badge.svg)](https://coveralls.io/r/IDSIA/bayesRecon?branch=main) The package `bayesRecon` implements several methods for probabilistic reconciliation of hierarchical time series forecasts. diff --git a/README.md b/README.md index b432987..752c6ee 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,7 @@ status](https://www.r-pkg.org/badges/version/bayesRecon)](https://CRAN.R-project experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![License: LGPL (\>= 3)](https://img.shields.io/badge/license-LGPL%20(%3E=%203)-yellow.svg)](https://www.gnu.org/licences/lgpl-3.0) -[![Codecov test -coverage](https://codecov.io/gh/IDSIA/bayesRecon/graph/badge.svg)](https://app.codecov.io/gh/IDSIA/bayesRecon) +[![coverage](https://coveralls.io/repos/github/IDSIA/bayesRecon/badge.svg)](https://coveralls.io/r/IDSIA/bayesRecon?branch=main) The package `bayesRecon` implements several methods for probabilistic