What these workflows do?
July 5, 2024 ยท View on GitHub
audit.yaml
This workflow scans dependencies of your package for vulnerabilities using
oysteR.
Dependencies can be retrieved either from DESCRIPTION file or from renv.lock file.
bioccheck.yaml
This workflow implements Bioconductor-specific R package checks with BiocCheck.
branch-cleanup.yaml
This workflow checks if any (non-default) branches had the last commit added to them more than a configurable number of days ago. If yes, such branches are deleted.
build-check-install.yaml
This workflow includes the following activities:
- Build an R package.
- Run
R CMD check. - Publish unit test summary.
- Catch any notes, warnings etc. in the
R CMD checkoutput. - Install the package.
gitleaks.yaml
This workflow runs gitleaks on the repo to discover
any secrets that might have been hardcoded.
Additionally, it runs presidio-cli to find
any personally identifiable information (PII) within the git repo.
grammar.yaml
This workflow uses write-good to check changed files
with names matching a pattern for English sentences that could be corrected.
Then, it adds annotations to the pull request so that problematic grammar can be reviewed.
licenses.yaml
This workflow generates a license report of R package's dependencies for continuous compliance.
links.yaml
This workflow checks whether URLs embedded in code and documentation are valid. This workflow uses
lychee to detect broken links. Occasionally, this check
will detect false positives of strings that look like URLs. To remedy, please add this false
positive to the .lycheeignore file.
linter.yaml
This workflow lints the codebase using super-linter.
pkgdown.yaml
Documentation for the R package is generated via this workflow. This workflow uses the
pkgdown framework to generate documentation in HTML,
and the HTML pages are then deployed to the gh-pages branch.
Moreover, an additional Versions dropdown is generated via the GitHub Action, so that
the end user can view multiple versions of the documentation for the package.
release.yaml
This workflow creates a GitHub release from a git tag and generates changelog based
on NEWS.md file.
roxygen.yaml
This workflow uses roxygen to generate .Rd files in
man/ directory. It also checks if manuals are up-to-date with roxygen comments in the code.
spelling.yaml
Spellchecks are performed by this workflow, and the
spelling R package is used to detect spelling mistakes.
In the inst/WORDLIST file, you can add words and/or acronyms that you want the
spell check to ignore.
style.yaml
Code style is enforced via the styler R package. The workflow
can be configured to commit files that had styling problems automatically, after
remediating the problems.
test-coverage.yaml
This workflow examines the test coverage of given R package with covr.
Following that, coverage report is added to the PR. Additional feature is the ability
to compare code coverage between branches, so the PR can be declined if the coverage
would decrease following the merge.
The second part of the workflow runs utilizes covtracer to:
- prepare traceability matrix
- identify untested behavior
- verify directly tested functions
validation.yaml
This workflow generates and publishes validation report.
version-bump.yaml
This workflow increases R package version in NEWS.md and DESCRIPTION files and
commits this change to the repository.
version.yaml
This workflow checks if NEWS.md and DESCRPTION files have the same R package version.
Adding unit test and coverage reports to pkgdown documentation
In order to add unit test reports and coverage reports to the documentation generated by pkgdown,
the following steps are needed.
-
If you'd like to have a custom branding in unit test report, add
unit-test-report-brandparameter to thebuild-check-install.yamlworkflow. See examples below. -
Don't use the
skip-r-cmd-installparameter so that unit test report gets generated. -
build-check-install.yamlandtest-coverage.yamlshould depend onpkgdown.yamlworkflow. This is to ensure that race condition wherepkgdown.yamlworkflow overwritesgh-pagesbranch is avoided. This can be done for example by:- setting the
needs: [docs]forbuild-check-install.yamlandtest-coverage.yamlworkflows, - or if the
build-check-install.yamlandtest-coverage.yamlare invoked from another workflow thanpkgdown.yaml, additional dependency can be added which will triggertest-coverage.yamlandbuild-check-install.yamlafterpkgdown.yamlhas finished running. See example below.
- setting the
-
_pkgdown.yamlshould be updated with the following contents to ensure that links to coverage report and unit test report appear in the navbar.navbar: structure: left: [intro, reference, articles, tutorials, news, reports] right: [search, github] components: reports: text: Reports menu: - text: Coverage report href: coverage-report/ - text: Unit test report href: unit-test-report/ github: icon: fa-github href: <url-to-the-repository>
Example configuration for main branch:
name: Check ๐
on:
push:
branches:
- main
workflow_run:
workflows: ["Docs ๐"]
types:
- completed
jobs:
r-cmd:
name: R CMD Check ๐งฌ
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
with:
unit-test-report-brand: >-
https://github.com/insightsengineering/hex-stickers/raw/main/thumbs/tern.png
coverage:
name: Coverage ๐
uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@main
Example configuration for tags:
name: Release ๐
on:
push:
tags:
- "v*"
jobs:
build:
name: Build package ๐
needs: [release, docs]
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
with:
unit-test-report-brand: >-
https://github.com/insightsengineering/hex-stickers/raw/main/thumbs/tern.png
coverage:
name: Coverage ๐
needs: [release, docs]
uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@main
docs:
name: Pkgdown Docs ๐
needs: release
uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@main
rhub.yaml
This is a workflow based on the official R-hub workflow with the main goal being to R CMD check the package on different environments corresponding to the CRAN checks.
