Github Action based on the Covtracer R package
GitHub Action based on the Covtracer R package.
Supported R version > 4.x
Composite
- Create new action file
.github/workflows/covtracer-check.yaml
and put example content:
---
name: CovtracerCheck
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
covtracer:
runs-on: ubuntu-latest
name: Covtracer
container:
image: rocker/verse:4.1.2
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Run rcmdcheck
run: |
R CMD build .
R CMD INSTALL --with-keep.source *.tar.gz
R CMD check *.tar.gz
- name: Run CovtracerCheck
uses: insightsengineering/covtracer-action@v1
env:
GITHUB_PAT: ${{ secrets.MY_PUBLIC_GITHUB_TOKEN }}
- Create PR to test CovtracerCheck action.
It is preferred to add secret like MY_PUBLIC_GITHUB_TOKEN
for repository or organization (Managing encrypted secrets)
to avoid GitHub download limit being set to unauthenticated account
.
-
GITHUB_PAT
:Description: Github user Personal Access Token - token required to read public repositories
Required:
false
-
path
:Description: Path to package's root
Required:
false
Default:
.
-
allow-failure
:Description: CovtracerCheck errors will give a warning instead of causing a pipeline failure.
Required:
false
Default:
false
-
ignored-file-types
:Description: CovtracerCheck can ignore non-code file types.
Required:
false
Default:
data,class
-
minimal-coverage
:Description: Minimal coverage threshold.
Required:
false
Default:
80
-
post-result-as-comment
:Description: Post the check result as a PR comment.
Required:
false
Default:
false
-
no-cache
:Description: Disable GitHub Action R dependency caching.
Required:
false
Default:
false