pleasing CRAN: Refine project description in DESCRIPTION file #310
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/test-coverage.yaml | |
# Run on pushes to main and on pull requests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
name: Test coverage | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'release' | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::mockery, any::pandoc, any::tinytable, any::covr, any::DT, any::htmltools, any::xml2, any::visNetwork, any::igraph, any::jsonlite, any::processx, any::dplyr, any::ggdag, any::knitr, any::reticulate, any::rix, any::rmarkdown, any::testthat, any::usethis | |
- name: Install nix just for some tests to pass, but dont use it | |
uses: cachix/install-nix-action@v31 | |
- name: Run covr, capture coverage and display | |
shell: bash | |
run: | | |
# Run coverage and sink full output to file | |
Rscript -e " | |
cov <- covr::package_coverage() | |
cov_list <- covr::coverage_to_list(cov) | |
cov_df <- as.data.frame(cov_list['filecoverage'][[1]]) | |
cov_df\$file <- rownames(cov_df) | |
cov_df <- cov_df[c(2, 1)] | |
colnames(cov_df) <- c('file', 'coverage') | |
total_cov <- cov_list['totalcoverage'] | |
sink('coverage.md') | |
cat(tinytable::save_tt(tinytable::tt(cov_df), 'gfm')) | |
sink() | |
# Append total coverage at end of markdown | |
cat(sprintf('\n\n\nTotal coverage: %s', total_cov), file = 'coverage.md', append = TRUE) | |
cov | |
" | |
- name: Append to GitHub Actions summary | |
shell: bash | |
run: | | |
cat coverage.md >> $GITHUB_STEP_SUMMARY |