From 6d4df5df5be5dc9311fa9a3e4d411ac68c7e2581 Mon Sep 17 00:00:00 2001 From: Dave Slager Date: Wed, 6 Nov 2024 11:30:42 -0800 Subject: [PATCH 1/5] add usethis-generated test coverage yml --- .github/workflows/test-coverage.yaml | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/test-coverage.yaml diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..9882260 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,61 @@ +# 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: [main, master] + pull_request: + branches: [main, master] + +name: test-coverage.yaml + +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: | + 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 From 32f40052b51784dc9d94ef220ee449a33384706a Mon Sep 17 00:00:00 2001 From: Dave Slager Date: Wed, 6 Nov 2024 11:32:33 -0800 Subject: [PATCH 2/5] add badges and rebuild readme.md --- README.Rmd | 5 +++++ README.md | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.Rmd b/README.Rmd index 1b08451..0fbf79b 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,6 +13,11 @@ knitr::opts_chunk$set( ) ``` + +[![R-CMD-check](https://github.com/FredHutch/VISCtemplates/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/FredHutch/VISCtemplates/actions/workflows/R-CMD-check.yaml) +[![Codecov test coverage](https://codecov.io/gh/FredHutch/VISCtemplates/graph/badge.svg)](https://app.codecov.io/gh/FredHutch/VISCtemplates) + + # VISCtemplates The goal of VISCtemplates is to: diff --git a/README.md b/README.md index 486b4e3..bfac33b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ + + +[![R-CMD-check](https://github.com/FredHutch/VISCtemplates/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/FredHutch/VISCtemplates/actions/workflows/R-CMD-check.yaml) +[![Codecov test +coverage](https://codecov.io/gh/FredHutch/VISCtemplates/graph/badge.svg)](https://app.codecov.io/gh/FredHutch/VISCtemplates) + # VISCtemplates @@ -66,7 +72,7 @@ Use a VISC Report: ``` r use_visc_report( - report_name = "VDCnnn_BAMA_PTreport_interim_blinded", # the name of the report file + report_name = "VDCnnn_BAMA_PT_Report_statusifapplicable", # the name of the report file path = "BAMA", # the path within the active directory, usually the name of the assay report_type = "bama" # "empty", "generic", "bama", or "nab" ) From b19f8eb73d8d63dbcf1bbfb0960c7bdd70eee7f7 Mon Sep 17 00:00:00 2001 From: Dave Slager Date: Wed, 6 Nov 2024 11:35:33 -0800 Subject: [PATCH 3/5] VISCtemplates modifications for standard test-coverage yml --- .github/workflows/test-coverage.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 9882260..7222284 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -2,9 +2,9 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: [main, master] + branches: [main, master, develop] pull_request: - branches: [main, master] + branches: [main, master, develop] name: test-coverage.yaml @@ -19,6 +19,17 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-tinytex@v2 + + - name: Preinstall required latex packages + run: > + tlmgr install + lastpage morefloats parskip pdflscape textpos multirow lipsum + fancyhdr colortbl soul setspace relsize makecell threeparttable + threeparttablex environ trimspaces + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true From 58487db3aae81ccf963e94d8e243ec21b7d8283d Mon Sep 17 00:00:00 2001 From: Dave Slager Date: Wed, 6 Nov 2024 14:06:17 -0800 Subject: [PATCH 4/5] not really needed since already testing way back to 4.0.4 --- .github/workflows/R-CMD-check.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 9309e32..984a133 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -22,7 +22,6 @@ jobs: - {os: windows-latest, r: 'release'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - {os: ubuntu-latest, r: '4.0.4', pandoc-version: '2.11.4'} env: From 0c2661a57ebcd28fd307caadfa8fe58e271311e0 Mon Sep 17 00:00:00 2001 From: Dave Slager Date: Wed, 4 Dec 2024 19:24:02 -0800 Subject: [PATCH 5/5] README.md had been edited instead of README.Rmd. Re-building from Rmd. --- README.Rmd | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.Rmd b/README.Rmd index 0fbf79b..81944b4 100644 --- a/README.Rmd +++ b/README.Rmd @@ -81,7 +81,7 @@ Use a VISC Report: ```{r eval=FALSE} use_visc_report( - report_name = "VDCnnn_BAMA_PT_Report_statusifapplicable", # the name of the report file + report_name = "VDCnnn_BAMA_PTreport_interim_blinded", # the name of the report file path = "BAMA", # the path within the active directory, usually the name of the assay report_type = "bama" # "empty", "generic", "bama", or "nab" ) diff --git a/README.md b/README.md index bfac33b..9664956 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Use a VISC Report: ``` r use_visc_report( - report_name = "VDCnnn_BAMA_PT_Report_statusifapplicable", # the name of the report file + report_name = "VDCnnn_BAMA_PTreport_interim_blinded", # the name of the report file path = "BAMA", # the path within the active directory, usually the name of the assay report_type = "bama" # "empty", "generic", "bama", or "nab" )