Skip to content

always run coverage report publishing #8

always run coverage report publishing

always run coverage report publishing #8

Workflow file for this run

# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches-ignore:
- updateREADME
workflow_dispatch: # Allow manual triggers
schedule:
- cron: '0 8 * * 4'
name: Coverage testing
permissions: read-all
jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
needs: coverage
- name: Test coverage
run: |
# Set covr verbose mode for detailed debugging
options(covr.verbose = TRUE)
# Try-catch to capture errors and print traceback
tryCatch({
cov <- covr::package_coverage(
quiet = FALSE,
clean = TRUE, # Ensures fresh environment for coverage
type = "tests",
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print("covr::package_coverage run successfully!")
# Save coverage results
covr::to_cobertura(cov)
}, error = function(e) {
print("Error during package_coverage:")
print(e)
traceback()
stop(e) # Re-raise the error to stop the process
})
shell: Rscript {0}
- uses: codecov/codecov-action@v4
with:
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
commit_parent: "false"