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
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test Action

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

jobs:
test:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Build action
run: npm run package

- name: Setup covdbg
uses: ./
with:
version: 'latest'

- name: Verify covdbg is in PATH
run: |
Write-Host "Checking if covdbg is available..."
Get-Command covdbg -ErrorAction SilentlyContinue
if ($?) {
Write-Host "✓ covdbg is in PATH"
} else {
Write-Host "✗ covdbg is not in PATH"
exit 1
}
shell: pwsh
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
lib/
dist/
*.log
.DS_Store
57 changes: 57 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Contributing to setup-covdbg

Thank you for your interest in contributing to setup-covdbg!

## Development Setup

1. Fork and clone the repository
2. Install dependencies:
```bash
npm install
```

## Making Changes

1. Make your changes in the `src/` directory
2. Build the TypeScript code:
```bash
npm run build
```
3. Package the action for distribution:
```bash
npm run package
```
4. Commit both the source changes and the compiled `dist/` files

## Testing

Test your changes locally using the test workflow:

1. Push your changes to a branch
2. The test workflow will run automatically on Windows runners
3. Verify that covdbg is properly downloaded and added to PATH

## Project Structure

- `src/main.ts` - Main action logic
- `action.yml` - Action metadata and configuration
- `dist/` - Compiled and bundled action code (must be committed)
- `.github/workflows/` - CI/CD workflows

## Code Style

- Follow existing TypeScript conventions
- Use meaningful variable names
- Add comments for complex logic
- Keep error messages clear and helpful

## Pull Request Process

1. Update documentation if needed
2. Ensure all tests pass
3. Update the README.md with details of changes if applicable
4. Your PR will be reviewed by maintainers

## Questions?

Open an issue for discussion or clarification.
131 changes: 130 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,131 @@
# setup-covdbg
An action to download a prebuilt covdbg and add it to the PATH

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 runners

## Usage

Add this action to your workflow:

```yaml
steps:
- name: Setup covdbg
uses: covdbg/setup-covdbg@v1
with:
version: '1.0.0'

- name: Run covdbg
run: covdbg --version
```

## Inputs

### `version` (required)

The version of covdbg to download and setup. This should be a semantic version string (e.g., `1.0.0`, `2.1.3`).

**Example:**
```yaml
with:
version: '1.0.0'
```

## Outputs

### `covdbg-path`

The path where covdbg was installed and cached.

**Example usage:**
```yaml
- name: Setup covdbg
id: setup-covdbg
uses: covdbg/setup-covdbg@v1
with:
version: '1.0.0'

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

## Complete Example Workflow

```yaml
name: Test covdbg

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

jobs:
test:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup covdbg
uses: covdbg/setup-covdbg@v1
with:
version: '1.0.0'

- name: Verify covdbg installation
run: |
covdbg --version
covdbg --help
```

## 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 (or uses '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

## Requirements

- Runs on Windows runners (windows-latest, windows-2022, windows-2019)
- Requires Node.js 20 runtime (automatically available on GitHub-hosted runners)

## Development

To build and package the action:

```bash
# Install dependencies
npm install

# Build TypeScript
npm run build

# Package for distribution
npm run package
```

**Note**: The `dist/` directory is not tracked in git. You must build the action locally before testing or using it.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
16 changes: 16 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Setup covdbg'
description: 'Download and setup covdbg on Windows runners'
author: 'covdbg'
branding:
icon: 'download'
color: 'blue'
inputs:
version:
description: 'Version of covdbg to download (e.g., 1.0.0, latest)'
required: true
outputs:
covdbg-path:
description: 'Path where covdbg was installed'
runs:
using: 'node20'
main: 'dist/index.js'
Loading