Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ on:

jobs:
test:
runs-on: windows-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: [ '1.4.0', 'latest' ]
os: [ windows-latest, windows-11-arm ]
version: [ '1.5.1', 'latest' ]
include:
- os: windows-latest
version: '1.4.0'

steps:
- name: Checkout
Expand Down
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This action downloads a specified version of covdbg, extracts it, caches it for
- Extracts the downloaded archive
- Caches the tool for faster subsequent runs
- Adds covdbg to the PATH automatically
- Supports Windows runners
- Supports Windows x64 and ARM64 runners

## Usage

Expand Down Expand Up @@ -41,6 +41,17 @@ 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.1.

**Example:**
```yaml
with:
version: '1.5.1'
architecture: 'arm64'
```

## Outputs

### `covdbg-path`
Expand Down Expand Up @@ -142,16 +153,17 @@ This action uses the GitHub Actions Toolkit, specifically:

The action performs the following steps:
1. Reads the `version` input parameter (required; use an explicit version or `latest`)
2. Constructs the download URL for the specified version from covdbg.com
3. Downloads the covdbg.zip archive containing covdbg.exe and libcovdbg.dll
4. Extracts the archive
5. Caches the extracted files for future workflow runs
6. Adds the tool directory to the system PATH
7. Sets the `covdbg-path` output
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 runners (windows-latest or windows-2022)
- 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
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
version:
description: 'Version of covdbg to download (e.g., 1.4.0, latest)'
required: true
architecture:
description: 'Architecture of covdbg to download (x64 or arm64). Defaults to the runner architecture.'
required: false
outputs:
covdbg-path:
description: 'Path where covdbg was installed'
Expand Down
24 changes: 20 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28248,20 +28248,36 @@ async function run() {
if (platform !== 'win32') {
throw new Error(`This action currently only supports Windows runners. Current platform: ${platform}`);
}
// Resolve the architecture (defaults to the runner's architecture)
const architecture = (core.getInput('architecture') || os.arch()).toLowerCase();
if (architecture !== 'x64' && architecture !== 'arm64') {
throw new Error(`Unsupported architecture: ${architecture}. Supported architectures: x64, arm64`);
}
core.info(`Using architecture ${architecture}`);
// Construct the download URL for covdbg
// Using the portable version from covdbg.com
const downloadUrl = version === 'latest'
? 'https://covdbg.com/download/latest/portable'
: `https://downloads.covdbg.com/covdbg-${version}-x64.zip`;
? `https://covdbg.com/download/latest/${architecture === 'arm64' ? 'portable-arm64' : 'portable'}`
: `https://downloads.covdbg.com/covdbg-${version}-${architecture}.zip`;
core.info(`Downloading covdbg from ${downloadUrl}`);
// Download the tool (covdbg.zip)
const downloadPath = await tc.downloadTool(downloadUrl);
let downloadPath;
try {
downloadPath = await tc.downloadTool(downloadUrl);
}
catch (error) {
if (error instanceof tc.HTTPError && error.httpStatusCode === 404) {
throw new Error(`covdbg ${version} is not available for ${architecture}` +
(architecture === 'arm64' ? ' (arm64 builds are available from covdbg 1.5.1)' : ''));
}
throw error;
}
core.info(`Downloaded to ${downloadPath}`);
// Extract the zip archive (contains covdbg.exe and libcovdbg.dll)
const extractPath = await tc.extractZip(downloadPath);
core.info(`Extracted to ${extractPath}`);
// Cache the tool for future runs
const cachedPath = await tc.cacheDir(extractPath, 'covdbg', version);
const cachedPath = await tc.cacheDir(extractPath, 'covdbg', version, architecture);
core.info(`Cached at ${cachedPath}`);
// Add the tool to the PATH (both covdbg.exe and libcovdbg.dll are in this directory)
core.addPath(cachedPath);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

30 changes: 24 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,42 @@ async function run(): Promise<void> {
throw new Error(`This action currently only supports Windows runners. Current platform: ${platform}`);
}

// Resolve the architecture (defaults to the runner's architecture)
const architecture = (core.getInput('architecture') || os.arch()).toLowerCase();
if (architecture !== 'x64' && architecture !== 'arm64') {
throw new Error(`Unsupported architecture: ${architecture}. Supported architectures: x64, arm64`);
}
core.info(`Using architecture ${architecture}`);

// Construct the download URL for covdbg
// Using the portable version from covdbg.com
const downloadUrl = version === 'latest'
? 'https://covdbg.com/download/latest/portable'
: `https://downloads.covdbg.com/covdbg-${version}-x64.zip`;
const downloadUrl = version === 'latest'
? `https://covdbg.com/download/latest/${architecture === 'arm64' ? 'portable-arm64' : 'portable'}`
: `https://downloads.covdbg.com/covdbg-${version}-${architecture}.zip`;

core.info(`Downloading covdbg from ${downloadUrl}`);

// Download the tool (covdbg.zip)
const downloadPath = await tc.downloadTool(downloadUrl);
let downloadPath: string;
try {
downloadPath = await tc.downloadTool(downloadUrl);
} catch (error) {
if (error instanceof tc.HTTPError && error.httpStatusCode === 404) {
throw new Error(
`covdbg ${version} is not available for ${architecture}` +
(architecture === 'arm64' ? ' (arm64 builds are available from covdbg 1.5.1)' : '')
);
}
throw error;
}
core.info(`Downloaded to ${downloadPath}`);

// Extract the zip archive (contains covdbg.exe and libcovdbg.dll)
const extractPath = await tc.extractZip(downloadPath);
core.info(`Extracted to ${extractPath}`);

// Cache the tool for future runs
const cachedPath = await tc.cacheDir(extractPath, 'covdbg', version);
const cachedPath = await tc.cacheDir(extractPath, 'covdbg', version, architecture);
core.info(`Cached at ${cachedPath}`);

// Add the tool to the PATH (both covdbg.exe and libcovdbg.dll are in this directory)
Expand Down