-
Notifications
You must be signed in to change notification settings - Fork 42
Add comprehensive local development and CI testing tools #279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add comprehensive local development and CI testing tools #279
Conversation
Implement complete act-based local CI testing system that provides perfect parity with GitHub Actions workflows: Features: - Individual CI job commands (act-lint, act-build, act-security, etc.) - Fork testing support for custom repositories - Automatic container cleanup with --rm flags - Development environment setup and prerequisites checking - Easy act tool installation with user guidance Benefits: - Prevents CI failures by catching issues locally - Uses GitHub workflows as single source of truth - Zero configuration drift between local and CI testing - Supports testing against feature branches and forks - Comprehensive developer onboarding with dev-help command Commands added: - dev-help: Show all available development commands - dev-check: Verify development prerequisites - rust-setup: Configure Rust development environment - act-install: Install act tool for local GitHub Actions - act-*: Run individual GitHub workflow jobs locally - act-*-fork: Test against custom repositories - act-clean: Manage Docker containers This replaces manual Docker CI setup with automated GitHub workflow execution via act, ensuring local development testing exactly matches the CI environment.
Add detailed documentation for local development and CI testing: docs/development/developer-tests.md: - Complete guide for local CI testing with act - Development environment setup instructions - Fork and branch testing workflows - Container management and troubleshooting - Performance tips and IDE integration README.md: - New Development section with quick start guide - Prerequisites and setup instructions - Links to detailed documentation - Integration with existing Contributing section Key features documented: - Perfect CI parity with GitHub Actions - act dependency installation via Justfile - Individual CI job testing (act-lint, act-build, etc.) - Fork testing capabilities for custom repositories - Automatic container cleanup and management - Development workflow recommendations This documentation enables contributors to test locally before pushing, preventing CI failures and improving development velocity.
51d62c3
to
1ca961a
Compare
need to rebase first. |
|
||
### Key Benefits | ||
|
||
- **Perfect CI Parity**: Uses exact same GitHub Actions workflows locally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish all my CI had this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was so embarrassed with my failed CI testing creating more work for others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements comprehensive local development and CI testing tools using act (GitHub Actions runner) to provide perfect parity between local development and GitHub CI environments. The implementation addresses issue #278 by enabling developers to run exact GitHub Actions workflows locally, catch CI failures before pushing, and test against forks and feature branches.
- Adds comprehensive local CI testing system using act with perfect GitHub Actions parity
- Implements development environment setup and prerequisites checking
- Provides extensive developer documentation and workflow guidance
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
docs/development/developer-tests.md | Comprehensive developer testing guide with setup instructions, CI testing workflows, and troubleshooting |
README.md | Added development section with quick start guide and local CI testing overview |
Justfile | Major expansion with 30+ new commands for development environment setup, local CI testing, and fork testing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Brian Boynton, MD <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Brian Boynton, MD <[email protected]>
Replace detailed Development section in README.md with a simple hyperlink to docs/development/developer-tests.md to improve README organization and reduce duplication.
Thanks for the feedback! I've moved the Development section out of the README as suggested and replaced it with a link to the comprehensive developer testing guide. This PR aims to improve developer experience by providing local CI testing tools that match GitHub Actions exactly. This should help catch issues before pushing, reduce CI failures, and save maintainers time on troubleshooting. The act integration lets developers run the same linting, security, and build checks locally that run in CI. Don't have 'act'? No worries there is an included command to install from inside this repo with |
I'm not sure I really like having a hard dep on The one thing I do understand it does better is that it helps with building/testing the examples, but I don't know that it justifies running everything with act (plus installing/updating the local containers for use as the runners) EDIT: For clarity, I really don't think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking as blocking so we can have the discussion about my comment above. Also left one comment
Justfile
Outdated
# Set up Rust development environment | ||
rust-setup: | ||
@echo "🦀 Setting up Rust development environment..." | ||
rustup toolchain install nightly --component rustfmt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like this to check and see if these things are installed first before updating. Otherwise it will update every day you run it (because it is installing nightly). I love having this target, but it should check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thomastaylor312 You're absolutely right on both points, and I completely agree that act should be
optional and not a hard dependency.
Making Act Truly Optional:
My intention was always to provide act as an additional testing method, not replace the existing workflow. I can modify the PR to:
- Remove act from dev-check - the core development prerequisites should remain the same
- Create a separate dev-check-ci command for those who want to use act
- Have rust-setup check existing installations first.
The PR would then be 100% backwards compatible:
- Existing developers continue using just test + cargo clippy as always
- New developers can optionally install act for exact CI validation
- CI continues working identically
Regarding Native CI Targets:
I understand your preference for just targets that use native Rust/Wasm toolchains. The challenge is that GitHub CI uses specific container environments, dependency versions, and configurations that are difficult to perfectly replicate natively. But you're right that for daily development, native tools are faster and more efficient.
Would you prefer to make act completely optional or is there another solution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! I would prefer to keep a short "how to use act
" page under docs/development explaining that this is a best-effort, and have links to nektos/acat docs. Avoid "perfect parity" language since in practice, we all know that it has meaninful gaps and we'd be setting false expectations.
Also, I am not a fan of introducing a bunch of just
targets. I would also prefer to remove changes to the Justfile, and have one neutral entry point like just ci-local-act
that runs act -W .github/workflows/rust.yml
and no fork shortcuts.
So, I’d accept a slimmer PR that adds a docs-only page describing optional act usage and introduces at most one neutral just ci-local-act
target (no job-level commands).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understand. I'll make it happen.
- Check if nightly toolchain is already installed before updating - Check if wasm32-wasip2 target is already added - Check if cargo tools are already installed individually - Only install missing components to prevent unnecessary daily updates - Maintain clear progress feedback for each check
- Remove act and docker from core dev-check prerequisites - Add separate dev-check-ci target for optional CI testing tools - Update help documentation to clarify dev-check-ci is optional - Maintain backwards compatibility for basic development workflow - Allow developers to use core tools without requiring act installation
Running local CI testing is now less restrictive and 'act' CI runs are optional. Added checks to the 'just dev-check' command so it's safe to run daily if desired. Any requests, deletions or additions? |
Fixes #278 - Add Local Development Testing Guide
Summary
This PR implements comprehensive local development and CI testing tools that provide perfect parity between local development and GitHub CI environments. This directly addresses issue #278 by providing developers with the tools needed to catch issues locally before pushing.
Problems Solved
Solution Overview
Implements act-based local CI testing system using GitHub workflows as single source of truth:
Key Features
New Justfile Commands
Development Environment
Local CI Testing (Perfect GitHub Parity)
Fork/Branch Testing
Container Management
Documentation Added
Usage Examples
Quick Setup (One-time)
Local CI Testing
Fork/Branch Testing
Benefits
For Contributors
For Maintainers
For Project
Implementation Details
act Integration
Documentation Structure
Backward Compatibility
Testing
This PR has been thoroughly tested:
Future Enhancements
This foundation enables future improvements:
This PR directly solves issue #278 by providing developers with the exact tools requested: comprehensive local development testing that matches GitHub CI behavior.