Skip to content

About

An action to download a prebuilt covdbg and add it to the PATH

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

setup-covdbg

A GitHub Action to download and setup covdbg on Windows runners.

Description

This action downloads a specified version of covdbg, extracts it, caches it for future runs, and adds it to the PATH so it can be used in subsequent workflow steps.

Features

  • Downloads a user-specified version of covdbg
  • Extracts the downloaded archive
  • Caches the tool for faster subsequent runs
  • Adds covdbg to the PATH automatically
  • Supports Windows x64 and ARM64 runners

Usage

Add this action to your workflow:

steps:
  - name: Setup covdbg
    uses: liasoft/setup-covdbg@v1
    with:
      version: '1.5.1'
  
  - name: Run covdbg
    run: covdbg --version

Inputs

version (required)

The version of covdbg to download and setup. 1.5.1 is the newest release, and latest follows the latest published release. Pin a version for reproducible builds.

Example:

with:
  version: '1.5.1'

architecture (optional)

The covdbg build to download: x64 or arm64. Defaults to the runner's architecture, so windows-11-arm runners get the native ARM64 build automatically. ARM64 builds are available from covdbg 1.5.0.

Example:

with:
  version: '1.5.1'
  architecture: 'arm64'

Outputs

covdbg-path

The path where covdbg was installed and cached.

Example usage:

- name: Setup covdbg
  id: setup-covdbg
  uses: liasoft/setup-covdbg@v1
  with:
    version: '1.5.1'

- name: Display installation path
  run: echo "Covdbg installed at ${{ steps.setup-covdbg.outputs.covdbg-path }}"

Complete Example Workflow

name: Test covdbg

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  test:
    runs-on: windows-latest
    
    steps:
      - name: Checkout code
        uses: actions/checkout@v6
      
      - name: Setup covdbg
        uses: liasoft/setup-covdbg@v1
        with:
          version: '1.5.1'
      
      - name: Verify covdbg installation
        run: |
          covdbg --version

Collecting coverage

Installing covdbg does not sign in to the license service, so the coverage step carries a credential of its own. Which one depends on whether the repository is public.

Public repositories need no secret

From covdbg 1.5.0, grant the job id-token: write and configure nothing else. covdbg presents the job's GitHub OIDC token, which proves which repository the run belongs to, and public repositories are free:

jobs:
  coverage:
    runs-on: windows-latest
    permissions:
      contents: read
      id-token: write      # lets covdbg prove which repository this run belongs to
    steps:
      # ... checkout, setup-covdbg, build ...
      - name: Collect coverage
        shell: pwsh
        run: covdbg --config .covdbg.yaml --output coverage.covdb .\build\Debug\test_app.exe

GitHub does not issue an OIDC token to a pull request from a fork, and no permissions: block changes that. Measure coverage on pushes and on pull requests from your own repository, and skip fork pull requests rather than letting them fail:

    if: >-
      github.event_name != 'pull_request' ||
      github.event.pull_request.head.repo.full_name == github.repository

Do not use pull_request_target to work around this: it runs with your repository's credentials and would execute code from the fork.

Private repositories carry a project token

Add a COVDBG_PROJECT_TOKEN Actions secret containing a covdbg project token authorized for your repository (the token's team decides the run), then pass it to the coverage step:

- name: Collect coverage
  shell: pwsh
  env:
    COVDBG_PROJECT_TOKEN: ${{ secrets.COVDBG_PROJECT_TOKEN }}
  run: covdbg --config .covdbg.yaml --output coverage.covdb .\build\Debug\test_app.exe

See liasoft/covdbg-quick-start for a complete C++ example. For local use, sign in with covdbg login.

How It Works

This action uses the GitHub Actions Toolkit, specifically:

  • @actions/core: For getting inputs, setting outputs, and logging
  • @actions/tool-cache: For downloading, extracting, and caching the covdbg binary

The action performs the following steps:

  1. Reads the version input parameter (required; use an explicit version or latest)
  2. Resolves the architecture (architecture input, or the runner's architecture)
  3. Constructs the download URL for the specified version and architecture from covdbg.com
  4. Downloads the covdbg.zip archive containing covdbg.exe and libcovdbg.dll
  5. Extracts the archive
  6. Caches the extracted files for future workflow runs
  7. Adds the tool directory to the system PATH
  8. Sets the covdbg-path output

Requirements

  • Runs on Windows x64 runners (windows-latest or windows-2022) and Windows ARM64 runners (windows-11-arm)
  • Requires the Node.js 24 action runtime and Actions Runner 2.327.1 or newer (automatically available on GitHub-hosted runners)

Development

To build and package the action:

# Install dependencies
npm ci

# Build TypeScript
npm run build

# Package for distribution
npm run package

Note

The dist/ directory is tracked in Git and is what GitHub Actions executes. Commit regenerated dist/ files whenever the action source changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An action to download a prebuilt covdbg and add it to the PATH

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages