Thank you for your interest in contributing to the Convert PowerShell module! This guide will help you get started with local development and understand our CI/CD workflow.
- Rust Toolchain: Install from rustup.rs
- Verify:
cargo --version
- Verify:
- PowerShell: Version 5.1 or PowerShell 7.x
- Verify:
$PSVersionTable.PSVersion
- Verify:
- Git: For version control
- Visual Studio Code: Recommended editor with PowerShell and Rust extensions
- cargo-audit: For security scanning (
cargo install cargo-audit) - Miri: For deep Rust analysis (requires nightly toolchain)
-
Clone the repository:
git clone https://github.com/austoonz/Convert.git cd Convert
-
Install PowerShell dependencies:
.\install_nuget.ps1 .\install_modules.ps1
The Convert module uses a unified build.ps1 script with parameter-driven workflows:
# Build Rust library
.\build.ps1 -Rust -Build
# Build PowerShell module
.\build.ps1 -PowerShell -Build
# Build both (default if no language specified)
.\build.ps1 -Build# Run PowerShell tests
.\build.ps1 -PowerShell -Test
# Run Rust tests
.\build.ps1 -Rust -Test
# Run all tests
.\build.ps1 -TestImportant: Tests automatically run in separate PowerShell processes to avoid DLL locking issues. The build script handles this automatically.
# Analyze PowerShell code (PSScriptAnalyzer)
.\build.ps1 -PowerShell -Analyze
# Analyze Rust code (clippy, fmt, check)
.\build.ps1 -Rust -Analyze
# Analyze both
.\build.ps1 -Analyze# Format PowerShell code
.\build.ps1 -PowerShell -Fix
# Format Rust code
.\build.ps1 -Rust -Fix
# Format both
.\build.ps1 -FixRun the full build pipeline (clean, analyze, test, build, package):
.\build.ps1 -Full# Clean PowerShell artifacts
.\build.ps1 -PowerShell -Clean
# Clean Rust artifacts
.\build.ps1 -Rust -Clean
# Clean everything
.\build.ps1 -Clean-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes to Rust or PowerShell code
-
Run tests frequently:
.\build.ps1 -Test -
Format and analyze code:
.\build.ps1 -Fix .\build.ps1 -Analyze
-
Run full build before committing:
.\build.ps1 -Full -
Commit your changes:
git add . git commit -m "Description of changes"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub
The Convert module uses GitHub Actions for continuous integration across multiple platforms:
- Platforms: Windows, Linux, macOS
- PowerShell Versions:
- Windows: PowerShell 5.1 and PowerShell 7.x (LTS)
- Linux/macOS: PowerShell 7.x (LTS)
- Architectures Tested:
- Windows x64
- Linux x64
- macOS x64 (Intel)
- macOS arm64 (Apple Silicon)
- Workflow File:
.github/workflows/ci.yml
When you push to any branch in the main repository:
- Rust Analysis: Code quality checks (clippy, fmt, security audit)
- Platform Builds: Parallel builds for Windows, Linux, and macOS targets
- Artifact Assembly: Combines all platform binaries into a universal module
- Platform Testing: Tests run on each platform/architecture:
- Windows x64 (PowerShell 5.1 + Core)
- Linux x64
- macOS x64 (Intel)
- macOS arm64 (Apple Silicon)
- Release Package (main branch only): Creates versioned ZIP for distribution
Important: For security reasons, pull requests from external forks require manual approval before workflows run.
- Create a fork of the repository
- Make your changes in your fork
- Create a Pull Request from your fork to the main repository
- Wait for approval: A repository maintainer will review your PR code
- Manual workflow approval: After code review, a maintainer will manually approve the workflow run
- Workflow runs: Once approved, the CI workflow will execute
Each time you push new commits to your PR, the workflow requires re-approval:
- Push new commits to your PR branch
- Wait for maintainer to review the new changes
- Maintainer manually approves the workflow run again
- Workflow executes with the latest changes
This security measure prevents malicious code from running automatically in the repository's context.
- Security: Prevents unauthorized code execution in the main repository
- Resource Protection: Prevents abuse of GitHub Actions minutes
- Code Quality: Ensures all external contributions are reviewed before testing
- Build Status: Check the GitHub Actions badge in the README
- Detailed Results: Click the badge or visit the "Actions" tab in the repository
- Test Reports: View test results in the workflow summary
- Artifacts: Download platform-specific or deployment artifacts from completed workflow runs
For detailed information about the GitHub Actions workflow architecture, see:
- Minimum Coverage: 85% code coverage for PowerShell code
- Test Framework: Pester 5.3.0+
- Test Location:
src/Tests/Unit/
Follow the Pester Testing Standards for comprehensive test coverage:
- Encoding/Format Support: Test all supported encodings
- Pipeline Support: Test single and array pipeline input
- Edge Cases: Test empty, null, special characters, Unicode, large inputs
- Error Handling: Test error conditions and ErrorAction behavior
- Performance: Test batch processing and large inputs
- Data Integrity: Test round-trip conversions and consistency
Critical: Always run tests in a new PowerShell process to avoid DLL caching issues:
# Correct - tests run in fresh process
pwsh -NoProfile -Command "Invoke-Pester -Path src\Tests\Unit\"
# Or use the build script (handles isolation automatically)
.\build.ps1 -PowerShell -TestNever run tests in the same session where you've imported the module manually.
- Follow PowerShell Coding Standards
- Use single quotes for static strings
- Use double quotes for variable expansion
- Prefer .NET methods over cmdlets for performance
- Always use named parameters for clarity
- Follow standard Rust conventions
- Run
cargo fmtbefore committing - Address all
cargo clippywarnings - Add SAFETY comments to all unsafe blocks
- Document public APIs with doc comments
- Use clear, descriptive commit messages
- Start with a verb in present tense (Add, Fix, Update, Remove)
- Reference issue numbers when applicable
Examples:
Add support for UTF-16 encoding in Base64 conversion
Fix memory leak in string_to_base64 function
Update README with GitHub Actions badge
Remove deprecated CodeBuild configuration
Always run the full build to ensure quality:
.\build.ps1 -FullThis runs:
- Clean - Remove old artifacts
- Analyze - Check code quality
- Test - Run all tests
- Build - Compile and assemble
- Package - Create deployment artifact
- Issues: Report bugs or request features via GitHub Issues
- Discussions: Ask questions in GitHub Discussions
- Documentation: Read the online documentation
Be respectful and constructive in all interactions. We're all here to build great software together.
By contributing to Convert, you agree that your contributions will be licensed under the same license as the project.