Skip to content

parasoft/parasoft-coverage-action

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

Repository files navigation

Parasoft Coverage

Build CodeQL Test

This action allows you to view coverage report results generated by Parasoft C/C++test, Jtest and dotTEST directly on GitHub. For more information about Parasoft tools, visit the official Parasoft website.

Quick Start

To display Parasoft coverage results on GitHub, you need to customize your workflow that generates a Parasoft coverage XML report by including this action after the report is generated.

Prerequisites

This action requires a Parasoft coverage report XML file to be generated by Parasoft C/C++test, Jtest or dotTEST.

To generate a Parasoft coverage XML report, you can either use command lines or perform the following actions:

Adding the Parasoft Coverage Action to a GitHub Workflow

Add the Parasoft Coverage action to your workflow to parse coverage reports generated by Parasoft C/C++test, Jtest and dotTEST, enabling results to be shown on GitHub.

Once the action is complete, the coverage results will be shown as a GitHub job summary.

- name: Parasoft Coverage
  uses: parasoft/[email protected]
  with:
    # Path or minimatch pattern to locate Parasoft coverage report files. If using a relative path, it is relative to the GitHub workspace directory.
    report: '**/coverage.xml'
    # Root path to the Parasoft tool or Java installation required to locate the Java environment for report processing. If not specified, the GitHub Action will attempt to use the path from the JAVA_HOME environment variable.
    parasoftToolOrJavaRootPath: 'path/to/java'

Example Workflows

Here is a basic workflow example to help you get started with the Parasoft Coverage action:

name: Parasoft Coverage

on:
  # Trigger the workflow on push or pull request events but only for the master (main) branch.
  push:
    branches: [ master, main ]
  pull_request:
    branches: [ master, main ]

  # Allows you to run this workflow manually from the Actions tab.
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel.
jobs:
  build:
    # Specifies the name of the job.
    name: Parasoft Coverage Action

    # Specifies the type of runner that the job will run on.
    runs-on: self-hosted

    # Steps represent a sequence of tasks that will be executed as part of the job.
    steps:
      # Checks out your repository under $GITHUB_WORKSPACE, so that your job can access it.
      - name: Checkout repository
        uses: actions/checkout@v4

      # Generate Parasoft coverage report.
      # This is an example using the Parasoft dotTest Action; you can replace it with other actions as needed.
      - name: Parasoft dotTEST
        uses: parasoft/[email protected]
        with:
          # Path to the dotTEST installation directory, which contains dottestcli.exe.
          installDir: 'path/to/dottest'
          # URL of the test configuration to be used for analysis.
          testConfig: 'builtin://Run VSTest Tests with Coverage'
          # Path to the solution to be analyzed.
          solution: 'path/to/**.sln'
          # Path to the directory where the report will be created.
          reportDir: 'path/to/report'

      # Execute the Parasoft Coverage action.
      - name: Parasoft Coverage
        uses: parasoft/[email protected]
        with:
            # Path or minimatch pattern to locate Parasoft coverage report files. If using a relative path, it is relative to the GitHub workspace directory.
            report: '**/coverage.xml'
            # Root path to the Parasoft tool or Java installation required to locate the Java environment for report processing. If not specified, the GitHub Action will attempt to use the path from the JAVA_HOME environment variable.
            parasoftToolOrJavaRootPath: 'path/to/java'

Action Parameters

The following inputs are available for this action:

Input Description
report Required. Path or minimatch pattern to locate Parasoft coverage report files. If using a relative path, it is relative to the GitHub workspace directory. e.g. ../coverage.xml.
parasoftToolOrJavaRootPath Root path to the Parasoft tool or Java installation required to locate the Java environment for report processing. If not specified, the GitHub Action will attempt to use the path from the JAVA_HOME environment variable.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5