Skip to content

AdamWyatt34/PDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

PDK (Pipeline Development Kit)

CI codecov

A unified CLI tool for running CI/CD pipelines locally across GitHub Actions, Azure DevOps, and GitLab CI.

Features

  • πŸš€ Run pipelines locally before pushing
  • πŸ”„ Support for multiple CI/CD platforms:
    • βœ… GitHub Actions (fully supported)
    • βœ… Azure DevOps (fully supported)
    • 🚧 GitLab CI (coming soon)
  • 🐳 Docker-based execution for isolation
  • πŸ› οΈ Tool-specific executors (.NET, npm, Docker)
  • ⚑ Fast iteration with host-based execution option
  • 🎯 Run specific jobs or steps
  • βœ… Validate pipeline syntax without execution
  • πŸ” Docker availability detection and diagnostics
  • πŸ‘€ Watch Mode for automatic re-execution on file changes
  • πŸ”¬ Dry-Run Mode for pipeline validation without execution
  • πŸ“ Structured Logging with correlation IDs and secret masking
  • πŸŽ›οΈ Step Filtering to run specific steps or skip slow ones

Getting Started

Prerequisites

  • .NET 8.0 SDK
  • Docker (for containerized execution)

Installation

dotnet build
dotnet pack src/PDK.CLI
dotnet tool install --global pdk

Usage

# Check system requirements
pdk doctor

# Validate a pipeline
pdk validate --file .github/workflows/ci.yml

# List jobs in a pipeline
pdk list --file .github/workflows/ci.yml

# Run entire pipeline
pdk run --file .github/workflows/ci.yml

# Run specific job
pdk run --file .github/workflows/ci.yml --job build

# Run specific step
pdk run --file .github/workflows/ci.yml --job build --step test

# Run on host instead of Docker
pdk run --file .github/workflows/ci.yml --host

Supported Step Types

PDK supports multiple step executors for different tools and platforms:

.NET CLI (dotnet)

Execute .NET commands in your pipeline.

- name: Build solution
  type: dotnet
  with:
    command: build        # restore, build, test, publish, run
    projects: "**/*.csproj"  # Optional: project glob pattern
    configuration: Release   # Optional: build configuration
    arguments: --no-restore  # Optional: additional arguments

Supported Commands:

  • restore - Restore NuGet packages
  • build - Build projects
  • test - Run tests
  • publish - Publish applications
  • run - Run applications

Features:

  • βœ… Tool availability validation
  • βœ… Project/solution glob patterns
  • βœ… Configuration support (Debug/Release)
  • βœ… Custom argument passing
  • βœ… Output capture and formatting

npm/Node.js (npm)

Execute npm commands for Node.js projects.

- name: Install dependencies
  type: npm
  with:
    command: install      # install, ci, build, test, run
    script: build         # Required for 'run' command
    arguments: --production  # Optional: additional arguments

Supported Commands:

  • install - Install dependencies (uses package.json)
  • ci - Clean install for CI environments
  • build - Run build script
  • test - Run tests
  • run - Run custom npm script

Features:

  • βœ… Tool availability validation
  • βœ… Custom script execution
  • βœ… Argument passing
  • βœ… Working directory support
  • βœ… Output capture

Docker (docker)

Execute Docker commands for container operations.

- name: Build Docker image
  type: docker
  with:
    command: build        # build, tag, run, push
    Dockerfile: Dockerfile
    context: .
    tags: myapp:latest,myapp:v1.0.0
    buildArgs: VERSION=1.0.0,ENV=prod

Supported Commands:

  • build - Build Docker images
  • tag - Tag images
  • run - Run containers
  • push - Push images to registry

Features:

  • βœ… Tool availability validation
  • βœ… Multi-tag support
  • βœ… Build arguments
  • βœ… Multi-stage build targets
  • βœ… Custom Dockerfile paths
  • βœ… Docker-in-Docker support (socket mounting)

Note: Docker commands require the Docker socket to be mounted into the runner container. Use docker:latest as the runner image.

Currently Supported

GitHub Actions:

  • βœ… Workflow parsing (.github/workflows/*.yml)
  • βœ… Common actions: actions/checkout, actions/setup-dotnet, actions/setup-node, actions/setup-python
  • βœ… Run commands with shell detection (bash, pwsh, python, etc.)
  • βœ… Environment variables (workflow, job, and step level)
  • βœ… Job dependencies (needs field)
  • βœ… Conditional expressions (if field)
  • βœ… Working directories
  • βœ… Timeout configuration
  • βœ… Continue on error flag

Current Limitations:

  • ❌ Matrix builds (planned)
  • ❌ Reusable workflows
  • ❌ Composite actions
  • ❌ Service containers
  • ❌ Outputs between jobs
  • ❌ Complex trigger definitions

Project Structure

PDK/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ PDK.CLI/           # Command-line interface
β”‚   β”œβ”€β”€ PDK.Core/          # Core models and abstractions
β”‚   β”œβ”€β”€ PDK.Providers/     # Provider-specific parsers
β”‚   └── PDK.Runners/       # Execution engines
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ PDK.Tests.Unit/
β”‚   └── PDK.Tests.Integration/
β”œβ”€β”€ examples/              # Example projects
β”‚   β”œβ”€β”€ dotnet-console/
β”‚   β”œβ”€β”€ dotnet-webapi/
β”‚   β”œβ”€β”€ nodejs-app/
β”‚   β”œβ”€β”€ docker-app/
β”‚   └── microservices/
β”œβ”€β”€ samples/               # Sample pipeline files
└── docs/                  # Documentation

Development

# Build
dotnet build

# Run tests
dotnet test

# Run CLI locally
dotnet run --project src/PDK.CLI -- run --file samples/github/ci.yml

Running Tests with Coverage

# Collect coverage
dotnet test --collect:"XPlat Code Coverage" --settings coverlet.runsettings

# Generate HTML report
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:**/coverage.cobertura.xml -targetdir:coveragereport -reporttypes:Html

# Open report
start coveragereport/index.html  # Windows
open coveragereport/index.html   # macOS
xdg-open coveragereport/index.html # Linux

Or use the convenience script:

./scripts/coverage.sh

Examples

PDK includes complete, working example projects:

Example Description
dotnet-console Simple .NET console application with tests
dotnet-webapi ASP.NET Core Web API with Swagger
nodejs-app Node.js application with npm
docker-app Docker multi-stage build example
microservices Multi-service architecture with parallel builds

Each example includes a complete CI workflow that you can run with PDK.

Roadmap

Implemented

  • GitHub Actions workflow parsing
  • Azure DevOps pipeline parsing
  • Docker container execution
  • Host-based execution
  • Tool executors (.NET, npm, Docker)
  • Configuration file support
  • Secret management
  • Artifact handling
  • Watch mode
  • Dry-run mode
  • Structured logging

Planned

  • GitLab CI support
  • Matrix builds
  • Service containers
  • Reusable workflows

Contributing

Contributions welcome! This is an early-stage project.

License

MIT

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •