CI/CD Workflow Architecture¶
Overview¶
The FiberPath CI/CD system has been completely reorganized for v3 to:
- Eliminate redundancy and improve maintainability
- Establish clear naming conventions
- Separate concerns (CI vs packaging vs deployment)
- Add missing automation (PyPI publishing, coordinated releases)
- Reduce GitHub Actions minutes usage
Structure¶
Composite Actions (.github/actions/)¶
Reusable setup steps used across multiple workflows:
-
setup-python/
-
Sets up Python 3.11 with uv package manager
- Creates virtual environment
- Installs dependencies with caching
- Configurable dependency groups
-
Used by: backend-ci, backend-publish, docs-ci, docs-deploy
-
setup-node/
-
Sets up Node.js 20
- Configures npm cache
- Installs GUI dependencies
-
Used by: gui-ci, gui-packaging
-
setup-rust/
- Sets up Rust toolchain
- Configures cargo cache
- Optionally installs Linux Tauri dependencies
- Used by: gui-ci, gui-packaging
Workflows (.github/workflows/)¶
CI Workflows (run on every push/PR)¶
backend-ci.yml - Python Backend CI
- Triggers: Push to main, PRs affecting Python code
- Jobs:
- Lint & Type Check (Ruff, MyPy)
- Test on ubuntu/macos/windows (pytest)
- Status:
gui-ci.yml - GUI CI
- Triggers: Push to main, PRs affecting GUI code
- Jobs:
- Lint & Type Check (ESLint, TypeScript)
- Test & Build (Vitest, coverage, Vite build)
- Status:
docs-ci.yml - Documentation CI
Deployment Workflows¶
docs-deploy.yml - Documentation Deployment
- Triggers: Push to main affecting docs/, manual dispatch
- Jobs:
- Build MkDocs site
- Deploy to GitHub Pages
- Permissions: contents:read, pages:write, id-token:write
- Status:
Packaging Workflows¶
gui-packaging.yml - GUI Installer Creation
- Triggers: Push to main affecting GUI, manual dispatch, releases
- Jobs:
- Build installers for Windows/macOS/Linux (Tauri)
- Upload artifacts (30 day retention)
- Upload release assets (if triggered by release)
- Timeout: 45 minutes per OS
- Status:
Publishing Workflows¶
backend-publish.yml - PyPI Publishing
- Triggers: GitHub releases, manual dispatch
- Jobs:
- Verify version matches tag
- Build distribution packages
- Publish to PyPI (trusted publishing)
- Environment: pypi (with deployment protection)
- Permissions: contents:read, id-token:write
- Status:
Release Orchestration¶
release.yml - Coordinated Release Management
- Triggers: Manual dispatch with version input
- Jobs:
- Validate version format and tag availability
- Create GitHub release with auto-generated notes
- Trigger backend-publish (PyPI)
- Trigger gui-packaging (installers)
- Inputs:
- version: Semantic version (e.g., 0.3.14)
- prerelease: Boolean flag
- Permissions: contents:write, id-token:write
- Status:
Workflow Naming Convention¶
Format: {component}-{purpose}.yml
- Component: backend | gui | docs | release
- Purpose: ci | packaging | publish | deploy
Trigger Strategy¶
| Workflow | Push (main) | Pull Request | Manual | Release |
|---|---|---|---|---|
| backend-ci | ✅ | ✅ | ❌ | ❌ |
| gui-ci | ✅ | ✅ | ❌ | ❌ |
| docs-ci | ✅ | ✅ | ❌ | ❌ |
| docs-deploy | ✅ | ❌ | ✅ | ❌ |
| gui-packaging | ✅ | ❌ | ✅ | ✅ |
| backend-publish | ❌ | ❌ | ✅ | ✅ |
| release | ❌ | ❌ | ✅ | ❌ |
Path Filters¶
Workflows only run when relevant files change:
- backend-ci:
fiberpath/**,fiberpath_api/**,fiberpath_cli/**,tests/**,pyproject.toml - gui-ci:
fiberpath_gui/**, workflow files, composite actions - docs-ci:
docs/**,mkdocs.yml,CONTRIBUTING.md,README.md - docs-deploy: Same as docs-ci
- gui-packaging:
fiberpath_gui/**, workflow files, composite actions
Release Process¶
Manual Release Steps¶
-
Prepare Release
-
Update version in
pyproject.toml - Update version in
fiberpath_gui/src-tauri/Cargo.toml - Update
CHANGELOG.mdwith release notes -
Commit changes:
git commit -m "Prepare release 0.3.14" -
Trigger Release Workflow
-
Go to Actions → Release → Run workflow
- Enter version:
0.3.14 - Set prerelease:
false -
Click "Run workflow"
-
Automated Steps
-
Validates version format
- Checks if tag exists
- Verifies version in pyproject.toml
- Creates Git tag (e.g.,
v0.3.14) - Creates GitHub release with auto-generated notes
- Triggers backend-publish (PyPI)
-
Triggers gui-packaging (installers)
-
Post-Release
- Verify PyPI upload: pypi.org/project/fiberpath
- Download GUI installers from GitHub release
- Test installers on Windows/macOS/Linux
- Announce release
Archived Workflows¶
Previous workflows moved to .github/workflows/archive/:
- ci.yml - Old monolithic Python CI (combined lint + test)
- gui.yml - Old GUI checks + packaging (redundant with gui-tests.yml)
- gui-tests.yml - Old GUI testing (redundant with gui.yml)
- docs-site.yml - Old docs deployment (replaced by docs-ci + docs-deploy)
Improvements Over Previous System¶
| Issue | Previous | New Solution |
|---|---|---|
| Redundancy | gui.yml and gui-tests.yml both ran linting/building | Single gui-ci.yml with all checks |
| Naming | Inconsistent (ci.yml, gui.yml, docs-site.yml) | Consistent {component}-{purpose}.yml |
| Setup duplication | Python/Node/Rust setup repeated in every workflow | Composite actions (DRY principle) |
| PyPI publishing | Manual process | Automated with trusted publishing |
| Release coordination | Manual trigger of each workflow | Single release.yml orchestrates all |
| Documentation | No workflow docs | This document + badges in README |
Caching Strategy¶
Python (setup-python)¶
- Virtual environment:
.venv/cached by OS + Python version + pyproject.toml hash - uv cache: Built-in caching from astral-sh/setup-uv@v3
Node.js (setup-node)¶
- npm modules:
~/.npmcached by actions/setup-node@v4 with package-lock.json hash
Rust (setup-rust)¶
- Cargo artifacts:
~/.cargo/+target/cached by OS + Cargo.lock hash - Binaries, registry, git index
Future Enhancements¶
- [ ] Add workflow status badges to README.md
- [ ] Document in CONTRIBUTING.md
- [ ] Add Codecov integration for coverage tracking
- [ ] Add dependabot for workflow action updates
- [ ] Add workflow matrix testing for multiple Python versions
- [ ] Add performance benchmarking workflow
- [ ] Add security scanning (Snyk, SAST)
- [ ] Add automatic changelog generation
- [ ] Add automatic version bumping
Troubleshooting¶
Workflow Not Triggering¶
- Check path filters - workflow only runs if affected files changed
- Verify branch name matches trigger configuration
- Check workflow file syntax (YAML validation)
- Look for workflow run history in Actions tab
Composite Action Errors¶
- Verify action.yml exists in correct location
- Check inputs are passed correctly from workflow
- Ensure shell type is specified (bash/pwsh)
- Review action logs for specific error messages
Failed Builds¶
- Check if dependencies changed (update lock files)
- Verify environment variables are set correctly
- Look for OS-specific issues (Linux deps for Tauri)
- Review cache invalidation (might need manual clear)
PyPI Publishing Failures¶
- Verify trusted publishing is configured in PyPI project settings
- Check version matches tag (validation step)
- Ensure workflow has id-token:write permission
- Verify environment "pypi" exists with protection rules