Link Search Menu Expand Document

GitHub Gradle Plugin

Maven Central

The com.groupcdg.pitest.github plugin provides two tasks

  • pitest-github
  • pitest-github-upload

The pitest-github task runs pitest against all modules for which it has been configured, then updates the current PR.

The pitest-github-upload task updates the PR based on previously generated gitci json files.

Parameters can be configured via a pitestGithub extension block

pitestGithub {
  mutantEmoji = ':vomiting_face:'
  trailingText = 'Happy mutant hunting'
}

Extension Parameters

When running in GitHub Actions, most required parameters will be autoset from environment variables. These parameters must be explicitly set in other environments.

repoToken

Required (Actions)

A GitHub Api token with access to the checks api.

In GitHub Actions this will be provided as a secret. If it exported as an environment variable named REPO_TOKEN the value will be automatically populated in the plugin.

Token authentication does not work for the checks api outside of GitHub actions. If you are using the plugin with a different CI system a private key and app id should be used to authenticate instead.

appId

Required (Other CI)

Required if authenticated outside of GitHub Actions.

The App Id of a single instance GitHub App with the following permissions

  • Checks - Read & write
  • Issues - Read & write
  • Pull Requests - Read & write

appKeyPath

Required (Other CI)

Required if authenticated outside of GitHub Actions.

The path to the private key registered with a GitHub App in PKCS#8 format.

GitHub generates keys in PKCS#1 format, but they can be converted via openssl using

openssl pkcs8 -topk8 -inform PEM -outform PEM -in key-downloaded-from-github.pem -out app-key.pem -nocrypt

sha

Required

Autoset

The head SHA for the pull request.

This value will be automatically populated from the GitHub payload json if the GITHUB_EVENT_PATH environment variable is set, and points to a valid GitHub file.

pullRequestId

Required

Autoset

The id of the pull request to update.

This value will be automatically populated from the GitHub payload json if the GITHUB_EVENT_PATH environment variable is set, and points to a valid GitHub file

repoName

Required

Autoset

The repository to update (e.g octocat/example). If present, this property will be automatically populated from an environment variable named GITHUB_REPOSITORY.

This environment variable is automatically set by GitHub Actions.

baseURl

Required

Autoset

The base URL of the GitHub api (e.g https://api.github.com). If present, this property will be automatically populated from an environment variable named GITHUB_API_URL.

This environment variable is automatically set by GitHub Actions.

githubEventPath

Required

Autoset

The path to the GitHub PR event payload. If present, this property will be automatically populated from an environment variable named GITHUB_EVENT_PATH.

This environment variable is automatically set by GitHub Actions.

mutantEmoji

Optional

Character string to use in summary table for surviving mutants.

killedEmoji

Optional

Character string to use in summary table when no surviving mutants.

trailingText

Optional

Custom text to place at end of summary.