Developer Guide¶
This guide walks through environment setup, repository structure, and local testing using nektos/act so you can confidently extend d-flows workflows and actions.
π Prerequisites¶
Ensure the following tooling is installed and accessible from your terminal:
- Docker Desktop (or Docker Engine) β required for
actcontainers. Verify withdocker --version. - PowerShell 7+ β cross-platform scripting runtime. Verify with
pwsh --version. - Git β source control. Verify with
git --version. - nektos/act β local GitHub Actions runner. Verify with
act --version. - Package Manager β WinGet on Windows (
winget --version) or a Linux/macOS equivalent to install dependencies.
Docker performance
Allocate at least 4 CPU cores and 6 GB RAM in Docker Desktop to match GitHub-hosted runner resources when executing integration tests.
π Quick Start¶
- Clone the repository
- Install
act(see ACT Setup Guide for OS-specific instructions) - Copy local secrets template
- Verify development prerequisites
- Run the full integration suite
π Project Structure¶
.github/workflows/β workflow definitions (deployment, release, validation, docs)actions/β composite actions used by workflowsdocs/β MkDocs content (this guide + ACT documentation)scripts/β PowerShell automationscripts/integration/β orchestratesacttest matricesscripts/dev/β helper utilities for contributorstests/β JSON fixtures & assets for each workflowtests/integration/β complex multi-workflow scenariostests/<workflow>/β targeted fixtures for unit-level validation.actrcβ shared configuration for act runner images and arguments.secrets.templateβ copy to.secretsfor local secret injection
π§ͺ Local Testing with Act¶
nektos/act mirrors GitHub-hosted runners locally using Docker containers.
- Follow ACT_SETUP_GUIDE.md for installation and Docker tuning.
- Use ACT_USAGE.md for scenario-based walkthroughs and troubleshooting tips.
- Common commands:
Speed up repeated runs
Pass --reuse to act or -SkipCleanup to Run-ActTests.ps1 when iterating on failures to avoid re-provisioning containers.
π§ Development Workflow¶
- Implement workflow or action changes
- Lint YAML with actionlint
- Execute targeted jobs locally
- Run integration harness
- Commit, push, and open a PR including relevant test evidence in the description
π§ͺ Testing Framework¶
- Unit-level fixtures β JSON payloads under
tests/<workflow>/emulate GitHub webhook events - Integration scenarios β
tests/integration/pairs PowerShell orchestration with persistent artifacts - State isolation β PowerShell scripts create GUID-based temp directories; pass
-SkipCleanupfor debugging - Harness scripts β
Run-ActTests.ps1bundles preparation, execution, log capture, and cleanup - Artifacts β Logs, traces, and snapshots stored under
tests/_artifactsfor later inspection
Refer to the βTest State Managementβ section of README.md for lifecycle details.
βοΈ Configuration¶
.actrcβ defines default runner images, container options, and artifact paths foract.secretsβ injects secrets into local runs; copy from.secrets.templateand keep it untrackedmkdocs.ymlβ docs navigation, theme, and versioning (Mike integration)
Example tweaks:
# Switch act to large runner image
echo '-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest' >> .actrc
# Add a temporary PAT for integration tests
echo 'GH_TOKEN=<token>' >> .secrets
π§ Troubleshooting¶
- Docker not running β ensure Desktop/Engine is up and restart containers
actmissing β confirm binary is in PATH (act --version)- Permission denied β run your shell as Administrator (Windows) or ensure user is in the
dockergroup - Failed tests β rerun with
-SkipCleanupto preserve reproducer artifacts - Workflow syntax errors β execute
./actionlintto surface lint feedback locally
For expanded act troubleshooting, see ACT_SETUP_GUIDE.md.