Skip to content

Commit

Permalink
Merge pull request #807 from pharmaR/jt-800-fix_codecov
Browse files Browse the repository at this point in the history
Fix test-coverage workflow
  • Loading branch information
aclark02-arcus authored Jul 10, 2024
2 parents 39eed4d + 67bc4f4 commit df1813b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
42 changes: 34 additions & 8 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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:
Expand All @@ -9,6 +9,8 @@ on:

name: test-coverage

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
Expand All @@ -24,21 +26,45 @@ jobs:
sudo apt-get update
sudo apt-get install -y texlive-xetex
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
use-public-rspm: false
r-version: 'renv'

- uses: r-lib/actions/setup-renv@v2

- name: Install riskassessment
shell: bash
run: R CMD INSTALL --preclean .

- 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
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4367,7 +4367,7 @@
"Maintainer": "Kevin Ushey <[email protected]>",
"Repository": "RSPM",
"Date/Publication": "2024-02-29 01:10:07 UTC",
"Built": "R 4.3.3; ; 2024-07-09 17:38:19 UTC; unix"
"Built": "R 4.3.3; ; 2024-07-10 13:11:46 UTC; unix"
}
},
"reprex": {
Expand Down Expand Up @@ -6175,7 +6175,7 @@
"checksum": "d74482ddef0a4941a51c077f5ea60e10"
},
".github/workflows/test-coverage.yaml": {
"checksum": "c0baef024db9ec1299aae4098e904e9c"
"checksum": "a854cdb9e1cfbcbbf5ccffdf4755606b"
},
".github/workflows/write-manifest.yaml": {
"checksum": "cdfc1470af653982867daed2b99d5b97"
Expand Down

0 comments on commit df1813b

Please sign in to comment.