Skip to content

Commit

Permalink
update test coverage workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
huizezhang-sherry committed Sep 13, 2024
1 parent 7c1ef86 commit 9563dfe
Show file tree
Hide file tree
Showing 9 changed files with 256,052 additions and 16 deletions.
21 changes: 5 additions & 16 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,43 @@ on:

name: test-coverage

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- 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
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
cov <- covr::package_coverage(
covr::codecov(
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
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
Binary file removed man/figures/README-layout-1.png
Binary file not shown.
9 changes: 9 additions & 0 deletions tests/testthat/_snaps/cubble-print.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@
10 ASN00086038 2020-01-10 0 34 19.6 145.
# i 20 more rows

# issue 35

Code
filter(climate_aus, name == "foo")
Output
# cubble: key: id [0], index: date, nested form
# i 7 variables: id <chr>, long <dbl>, lat <dbl>, elev <dbl>, name <chr>,
# wmo_id <dbl>, ts <list>

42,673 changes: 42,673 additions & 0 deletions tests/testthat/_snaps/glyph/geom-glyph-x-scale-identity-str.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42,673 changes: 42,673 additions & 0 deletions tests/testthat/_snaps/glyph/geom-glyph-x-scale-identity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42,673 changes: 42,673 additions & 0 deletions tests/testthat/_snaps/glyph/geom-glyph-x-scale-range01.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42,673 changes: 42,673 additions & 0 deletions tests/testthat/_snaps/glyph/geom-glyph-y-scale-identity-str.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42,673 changes: 42,673 additions & 0 deletions tests/testthat/_snaps/glyph/geom-glyph-y-scale-identity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42,673 changes: 42,673 additions & 0 deletions tests/testthat/_snaps/glyph/geom-glyph-y-scale-range01.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9563dfe

Please sign in to comment.