Skip to content

better readme

better readme #300

Workflow file for this run

# .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