Skip to content

Commit

Permalink
Extends the test reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik Sparre Spiegelhauer (HSPU) committed Mar 15, 2024
1 parent 62e189b commit 06f1543
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
error-on: '"error"'
check-dir: '"check"'
upload-results: true
31 changes: 25 additions & 6 deletions .github/workflows/Test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,41 @@ jobs:
any::knitr
needs: coverage

- name: Test coverage
# - name: Test coverage
# run: |
# covr::codecov(
# quiet = FALSE,
# clean = FALSE,
# install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
# )
# shell: Rscript {0}

- name: Run tests with coverage
run: |
covr::codecov(
quiet = FALSE,
junit_file <- file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "reports", "test-out.xml")
pkg_install_path <- file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
covr::package_coverage(
type = "none",
code = "options(testthat.output_file = junit_file);testthat::test_dir('tests/testthat', reporter = 'junit')",
install_path = "pkg_install_path",
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
quiet = FALSE)
shell: Rscript {0}

- name: Show testthat output
- name: Show testthat output in console
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
${{ runner.temp }}/reports/test-out.xml
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 06f1543

Please sign in to comment.