Skip to content

Commit

Permalink
Trying to get test coverage working
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerssam committed May 23, 2024
1 parent c9c5e98 commit ab8debe
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
runs-on: ubuntu-22.04
env:
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# vsni_LICENSE: ${{ secrets.vsni_LICENSE }}

steps:
Expand All @@ -32,8 +33,8 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, any::covr, asreml=?ignore-before-r=5.0.0
needs: check
extra-packages: any::covr, any::xml2, asreml=?ignore-before-r=5.0.0
needs: coverage

# - name: Create and populate .Renviron file
# run: echo vsni_LICENSE="vsni_LICENSE" >> ~/.Renviron
Expand All @@ -45,5 +46,33 @@ jobs:
# shell: Rscript {0}

- name: Test coverage
run: covr::codecov()
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()
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

0 comments on commit ab8debe

Please sign in to comment.