A GitHub Action to download and setup covdbg on Windows runners.
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.
- 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
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 --versionThe 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'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'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 }}"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 --versionInstalling 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.
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.exeGitHub 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.repositoryDo not use pull_request_target to work around this: it runs with your repository's credentials and would execute code from the fork.
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.exeSee liasoft/covdbg-quick-start for a complete C++ example. For local use, sign in with covdbg login.
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:
- Reads the
versioninput parameter (required; use an explicit version orlatest) - Resolves the architecture (
architectureinput, or the runner's architecture) - Constructs the download URL for the specified version and architecture from covdbg.com
- Downloads the covdbg.zip archive containing covdbg.exe and libcovdbg.dll
- Extracts the archive
- Caches the extracted files for future workflow runs
- Adds the tool directory to the system PATH
- Sets the
covdbg-pathoutput
- 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)
To build and package the action:
# Install dependencies
npm ci
# Build TypeScript
npm run build
# Package for distribution
npm run packageNote
The dist/ directory is tracked in Git and is what GitHub Actions executes. Commit regenerated dist/ files whenever the action source changes.
This project is licensed under the MIT License - see the LICENSE file for details.