Skip to content

insightsengineering/covtracer-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Covtracer Action

Github Action based on the Covtracer R package

Description

GitHub Action based on the Covtracer R package.

Supported R version > 4.x

Action Type

Composite

Quick Start

  1. 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 }}
  1. Create PR to test CovtracerCheck action.

Environment variables

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

Inputs

  • 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