isee.local_cli¶
Run GitHub Actions workflows locally using act.
This module automates running your CI pipeline locally before pushing to GitHub. It checks for required dependencies (act, Docker) and provides clear setup instructions if anything is missing.
Usage:
# Check if everything is set up
python -m isee.local_cli --check-deps
# Run entire CI workflow (fast, clean - no local artifacts)
python -m isee.local_cli
# Run with local artifacts for debugging
python -m isee.local_cli --bind
# Run just validation job (all matrix combinations)
python -m isee.local_cli -j validation
# Run specific matrix combination
python -m isee.local_cli -j validation -m python-version:3.12
# For M-series Macs (if needed)
python -m isee.local_cli --container-arch linux/amd64
# See what would run without executing
python -m isee.local_cli --dry-run
# Quiet mode (less output)
python -m isee.local_cli -q
Functions
|
Check if act and Docker are available and provide setup instructions if not. |
|
CLI entry point for running CI locally. |
|
Run CI workflow locally using act. |
|
Run a GitHub Actions workflow locally using act. |
- isee.local_cli.check_dependencies(*, verbose=True)[source]¶
Check if act and Docker are available and provide setup instructions if not.
>>> ready, missing = check_dependencies(verbose=False) >>> isinstance(ready, bool) and isinstance(missing, list) True
- isee.local_cli.run_ci(*, job=None, matrix=None, dry_run=False, workflow_file='.github/workflows/ci.yml', verbose=True, bind=False, container_arch=None)[source]¶
Run CI workflow locally using act.
- Parameters:
job (
str|None) – Specific job to run (e.g., ‘validation’). If None, runs all jobs.matrix (
str|None) – Matrix combination (e.g., ‘python-version:3.12’). Requires job to be set.dry_run (
bool) – If True, list what would run without executing.workflow_file (
str) – Path to workflow file to run.verbose (
bool) – If True, print progress information.bind (
bool) – Mount working directory (creates local artifacts like dist/).container_arch (
str|None) – Container architecture (e.g., ‘linux/amd64’ for M-series Macs).
- Return type:
- Returns:
Exit code (0 for success, non-zero for failure).
Examples
>>> # These examples don't actually run act, just demonstrate the interface >>> # run_ci(job='validation', matrix='python-version:3.12') # Run one matrix combo >>> # run_ci(job='validation') # Run all validation matrix combos >>> # run_ci(dry_run=True) # See what would run