A unified CLI tool for running CI/CD pipelines locally across GitHub Actions, Azure DevOps, and GitLab CI.
- π 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
- .NET 8.0 SDK
- Docker (for containerized execution)
dotnet build
dotnet pack src/PDK.CLI
dotnet tool install --global pdk# 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 --hostPDK supports multiple step executors for different tools and platforms:
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 argumentsSupported Commands:
restore- Restore NuGet packagesbuild- Build projectstest- Run testspublish- Publish applicationsrun- Run applications
Features:
- β Tool availability validation
- β Project/solution glob patterns
- β Configuration support (Debug/Release)
- β Custom argument passing
- β Output capture and formatting
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 argumentsSupported Commands:
install- Install dependencies (uses package.json)ci- Clean install for CI environmentsbuild- Run build scripttest- Run testsrun- Run custom npm script
Features:
- β Tool availability validation
- β Custom script execution
- β Argument passing
- β Working directory support
- β Output capture
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=prodSupported Commands:
build- Build Docker imagestag- Tag imagesrun- Run containerspush- 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.
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 (
needsfield) - β
Conditional expressions (
iffield) - β 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
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
# Build
dotnet build
# Run tests
dotnet test
# Run CLI locally
dotnet run --project src/PDK.CLI -- run --file samples/github/ci.yml# 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 # LinuxOr use the convenience script:
./scripts/coverage.shPDK 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.
- 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
- GitLab CI support
- Matrix builds
- Service containers
- Reusable workflows
Contributions welcome! This is an early-stage project.
MIT