This directory contains all GitHub Actions workflows for the classdock repository. Each workflow serves a specific purpose in our CI/CD pipeline and repository management.
UPDATED: Our workflows have been completely modernized and consolidated with:
- π¦ 25 Optimized Workflows: Streamlined from 26 to 25 through intelligent consolidation
- π§ Consolidated Testing: Eliminated duplicate test-python-wrapper.yml, integrated into main ci.yml
- π‘οΈ Enhanced Coverage: Comprehensive pytest integration with coverage reporting
- π§ͺ Unified CI Pipeline: Single, efficient testing workflow with matrix support
- π Improved Reporting: Centralized test results and coverage artifacts
| Workflow | Trigger | Purpose | Status |
|---|---|---|---|
| π€ auto-release.yml | Push to main |
Quick automated releases from feature branches | β Active |
| π release.yml | Git tags (v*.*.*) |
Official production releases with full validation | β Active |
| π branch-name-check.yml | PR creation/updates | Enforce branch naming conventions | β Active |
| π‘οΈ branch-protection.yml | Manual dispatch | Apply protection rules to main branch | β Active |
| π§ͺ ci.yml | PR/Push events | ENHANCED: Comprehensive Python testing with coverage | β Active |
| π auto-update.yml | Weekly schedule | Automated dependency updates | β Active |
| π§ͺ integration.yml | PR/Push events | Cross-platform integration testing | β Active |
No secrets required! Our publish workflow now uses OpenID Connect for secure PyPI publishing:
- π Trusted Publishing: GitHub OIDC directly authenticates with PyPI
- π‘οΈ Zero Token Management: No need to store or rotate API tokens
- β Enhanced Security: Eliminates secret exposure risks
- β‘ Better Performance: Direct authentication without token lookups
Setup Required: Configure trusted publishing on PyPI project settings.
| Secret | Purpose | Required For | Status |
|---|---|---|---|
GITHUB_TOKEN |
GitHub API access (auto-provided) | All workflows | β Auto |
GH_PAT |
Enhanced permissions for protection | Branch protection | β Required |
PYPI_API_TOKEN |
π Replaced by OIDC |
- π Python Actions v5: Updated setup-python for faster dependency installation
- π¦ Optimized Caching: Aligned Poetry virtualenv strategy with cache paths
- π Smart Retries: Exponential backoff for all network operations
- π§Ή Cache Cleanup: Removed unused lint cache directories for efficiency
Enhanced permission model with OIDC integration:
contents: write- Create releases and update filespull-requests: write- Create and update PRsid-token: write- NEW: OIDC token generation for PyPI publishingattestations: write- NEW: Build attestation generationactions: read- Workflow context access
Major Workflow Refactoring (October 2025): Our workflows have been completely transformed with:
- 28 Extracted Scripts: All complex logic moved to reusable
.github/scripts/ - Workflow Authoring Guidelines Compliance: 100% adherence to β€6 line inline script rule
- Centralized Utilities: Shared
workflow_utils.shfor consistent error handling and logging
- Configuration Validation: Comprehensive validation before workflow execution
- Graceful Failure Management: Proper error recovery and meaningful error messages
- Cross-Platform Compatibility: Testing across ubuntu-latest with bash/zsh shells
- Integration Testing Workflow: Full end-to-end testing with multiple configuration scenarios
- GitHub API Testing: Authentication, rate limiting, and API compatibility validation
- Error Recovery Testing: Validation of error handling scenarios
- Build Time Aggregation: Performance tracking across all workflow steps
- Workflow Health Scoring: Automated health assessment and trend analysis
- Status Aggregation: Comprehensive workflow status reporting
Previous Updates (September 2025): Modern best practices foundation:
- π οΈ Workflow Utilities: New centralized logging and retry mechanisms via
workflow_utils.sh - π OIDC Publishing: Migrated to trusted PyPI publishing eliminating API token dependencies
- β‘ Performance: Optimized caching strategies and updated to Python setup v5
- π‘οΈ Error Handling: Standardized retry logic and comprehensive error reporting
- π¦ Build Quality: Enhanced build verification and content validation
- π§ Infrastructure: Improved cache efficiency and removed unused paths
These improvements provide more reliable, secure, and maintainable automation across all workflows.
File: workflows/auto-release.yml
Automatically creates releases when feature branches are merged to the main branch. Designed for quick development iterations and continuous deployment.
- Push to
mainbranch (only when merged fromrelease/*orhotfix/*branches)
- β Automatic version detection from branch names
- β PR-based changelog generation
- β GitHub release creation
- β Fast deployment for development cycles
# Create a release branch
git checkout -b release/1.2.3
# Make your changes and commit
git add .
git commit -m "feat: add new feature"
# Push and create PR
git push origin release/1.2.3
# Create PR to main branch
# Once merged β auto-release.yml triggers automaticallyrelease/X.Y.Z(e.g.,release/1.2.3)hotfix/X.Y.Z(e.g.,hotfix/1.2.1)
File: workflows/publish.yml
Creates comprehensive, production-ready releases with full validation, testing, and security scanning. Used for major releases and production deployments.
- Git tags matching pattern
v*.*.*(e.g.,v1.2.3,v2.0.0-beta.1) - Manual workflow dispatch
- π OIDC Publishing: Migrated to trusted PyPI publishing (no API tokens required)
- π Python v5: Updated setup-python action for faster performance
- π¦ Build Quality: Enhanced build content verification and validation
- π Smart Retries: Standardized retry logic for PyPI verification
- π Centralized Logging: Integrated workflow_utils.sh for consistent messaging
- β Comprehensive validation and testing across Python 3.10, 3.11, 3.12
- β OIDC-based PyPI publishing (secure, no token management)
- β Enhanced build verification with content validation
- β Poetry-based dependency management with optimized caching
- β Detailed release notes generation
- β Pre-release support (alpha, beta, RC)
- β Smart retry mechanisms for network operations
- β GitHub release creation with artifacts
- Stable:
v1.2.3 - Alpha:
v1.2.3-alpha.1 - Beta:
v1.2.3-beta.1 - Release Candidate:
v1.2.3-rc.1
# For stable releases
git tag v1.2.3
git push origin v1.2.3
# For pre-releases
git tag v1.3.0-beta.1
git push origin v1.3.0-beta.1
# For release candidates
git tag v2.0.0-rc.1
git push origin v2.0.0-rc.1File: workflows/branch-name-check.yml
Enforces branch naming conventions to maintain consistency and enable automation.
- Pull Request events (opened, edited, synchronize, reopened) targeting
mainordevelop
feature/*- New featuresbugfix/*- Bug fixeshotfix/*- Critical fixesrelease/*- Release preparationdocs/*- Documentation updateschore/*- Maintenance tasks
β Valid branch names:
feature/add-user-authenticationbugfix/fix-login-issuehotfix/1.2.1release/2.0.0docs/update-readmechore/update-dependencies
β Invalid branch names:
my-feature(missing prefix)FEATURE/add-login(wrong case)fix_bug(wrong separator)
File: workflows/branch-protection.yml
Automatically applies protection rules to the main branch to ensure code quality and security.
- Manual dispatch (
workflow_dispatch)
- β Require pull request reviews
- β Require status checks to pass
- β Require branches to be up to date
- β Require conversation resolution
- β Restrict pushes to main branch
- Go to Actions tab in GitHub
- Select Branch Protection workflow
- Click Run workflow
- Protection rules will be applied to
mainbranch
File: workflows/ci.yml
Runs comprehensive tests and quality checks on all code changes to ensure stability and quality.
- Pull Request events (opened, synchronize, reopened)
- Push to main branch
- π Python Setup v5: Updated to latest setup-python action for better performance
- π¦ Optimized Caching: Removed unused lint cache paths, improved cache hit rates
- π Retry Logic: Standardized retry_with_backoff across all operations
- π‘οΈ Test Quality: Fixed help command tests that were masking failures
- π Enhanced Logging: Integrated workflow_utils.sh for consistent messaging
- Operating Systems: Ubuntu, macOS, Windows
- Shells: bash, zsh
- β Syntax validation
- β ShellCheck static analysis (with optimized caching)
- β Script execution tests (with proper failure detection)
- β Configuration validation
- β Cross-platform compatibility
- β Help command validation (no longer masks failures)
File: workflows/auto-update.yml
Automatically updates dependencies and creates pull requests for review.
- Weekly schedule (Sundays at 2 AM UTC)
- Manual dispatch (
workflow_dispatch)
- β GitHub Actions versions
- β Shell dependencies
- β Configuration updates
- β Security patches
- β Repository health checks
File: workflows/integration.yml
NEW: Comprehensive end-to-end testing with real GitHub API integration and multiple configuration scenarios. Validates the complete classdock workflow in realistic environments.
- Pull Request events (opened, synchronize, reopened)
- Push to main branch
- β Cross-Platform Testing: Ubuntu Latest with multiple shell environments for compatibility
- β Real GitHub API Integration: Tests actual API calls with authentication
- β Configuration Validation: Multiple test scenarios with different config setups
- β Error Recovery Testing: Validates graceful failure handling
- β Rate Limiting Tests: GitHub API rate limit respect verification
- β Authentication Scenarios: Token validation and permission testing
- Basic Configuration: Standard setup with minimal requirements
- Advanced Configuration: Full feature set with all options enabled
- Error Conditions: Invalid configurations and recovery testing
- Performance Testing: Large repository and batch operation validation
- Extracted Scripts: All test logic in
.github/scripts/for reusability - Comprehensive Logging: Full execution tracing and debug information
- Clean Environment: Fresh test environment for each scenario
- Result Aggregation: Consolidated test reporting and status validation
File: workflows/test-python-wrapper.yml
NEW: Specialized testing for Python wrapper functionality and CLI integration. Ensures the classdock Python package works correctly across different environments.
- Pull Request events (opened, synchronize, reopened)
- Push to main branch
- β CLI Command Testing: Validates all command-line interfaces
- β Python Environment Testing: Multiple Python versions (3.10, 3.11, 3.12)
- β Package Installation: Tests pip installation and dependency resolution
- β Module Import Testing: Validates Python module structure
- β Configuration Loading: Tests config file parsing and validation
- β Error Handling: Python exception handling and error reporting
- Installation Testing: Package installation via pip and Poetry
- Command Line Interface: All CLI commands and option validation
- Configuration System: Config file loading and environment variables
- Python API: Direct Python module usage and integration
- Cross-Platform: Windows, macOS, and Linux compatibility
- Type Checking: Static type validation with mypy
- Code Coverage: Comprehensive test coverage reporting
- Lint Validation: Python code style and quality checks
- Security Scanning: Dependency vulnerability assessment
# Create feature branch (follows naming conventions)
git checkout -b feature/my-new-feature
# Develop and test locally
# Push and create PR β CI runs automatically
git push origin feature/my-new-feature# Create release branch for automatic deployment
git checkout -b release/1.2.3
# Finalize release changes
git push origin release/1.2.3
# Create PR to main β Auto-release triggers after merge# Create and push semantic version tag
git tag v1.2.3
git push origin v1.2.3
# β Full validation and production release process- Go to Actions tab in GitHub
- Select Branch Protection workflow
- Click Run workflow
- Protection rules applied to
mainbranch
- Check Actions tab for workflow status
- Review failed workflows and address issues
- Monitor automated updates and approve PRs
- Ensure all required secrets are configured
Our workflows now use centralized utilities for consistent logging and error handling:
File: .github/scripts/workflow_utils.sh
# Standardized logging with timestamps and formatting
log_info "Processing step..." # Blue info messages
log_success "β
Step completed!" # Green success messages
log_warning "β οΈ Non-critical issue" # Yellow warnings
log_error "β Critical failure" # Red error messages# Smart retry with exponential backoff
retry_with_backoff "command_to_retry" "description" max_attempts
# Example usage in workflows
retry_with_backoff "poetry install" "dependency installation" 3
retry_with_backoff "pip index versions package" "PyPI verification" 5- Consistent formatting: All workflows use unified message styling
- Automatic timestamps: Every message includes execution time
- Smart retries: Exponential backoff for transient failures
- Error aggregation: Centralized error handling patterns
- Safe sourcing: No global strict mode conflicts
Our 28 extracted scripts in .github/scripts/ provide modular functionality:
workflow_utils.sh- Centralized logging and retry mechanismssetup_environment.sh- Environment configuration and validationaggregate_build_times.sh- Performance monitoring and metricsworkflow_status_aggregator.sh- Health scoring and status reporting
test_cli_commands.sh- CLI functionality validationrun_integration_tests.sh- End-to-end integration testingcreate_integration_test_config.sh- Test configuration generationvalidate_github_api.sh- GitHub API authentication and compatibility
setup_github_auth.sh- Authentication configurationtest_github_api_auth.sh- API authentication validationtest_github_api_rate_limiting.sh- Rate limiting compliance testingcheck_github_token_permissions.sh- Permission validation
validate_config_files.sh- Configuration file validationtest_error_handling.sh- Error scenario testingsetup_test_environment.sh- Clean test environment preparation
install_dependencies.sh- Dependency installation with retry logicrun_quality_checks.sh- Code quality and lint validationpackage_and_test.sh- Package building and testingverify_pypi_package.sh- PyPI package verification
- π Reusability: Scripts used across multiple workflows
- π§ͺ Testability: Individual script testing and validation
- π Maintainability: Centralized logic easier to update
- π Debuggability: Isolated execution for troubleshooting
- π Consistency: Standardized patterns across all workflows
- β
Ensure branch name follows
release/*orhotfix/*pattern - β Verify branch was actually merged to main (not just pushed)
- β
Check
GITHUB_TOKENhas sufficient permissions - β Review workflow logs in Actions tab
- β
Use approved prefixes:
feature/,bugfix/,hotfix/,release/,docs/,chore/ - β
Use lowercase with hyphens:
feature/my-feature - β Avoid underscores or mixed case
- β
Run ShellCheck locally:
shellcheck scripts/*.sh - β Test scripts in different shells (bash, zsh)
- β Check file permissions and executable bits
- β Verify script paths are correct
- β Check GitHub API authentication and token permissions
- β Verify configuration file format and required fields
- β Review rate limiting and API usage patterns
- β Check cross-platform compatibility issues
- β Ensure Python environment is properly configured
- β Check package dependencies and version compatibility
- β Verify CLI command syntax and option handling
- β Review Python import paths and module structure
- β
Ensure tag follows semantic versioning:
v1.2.3 - β Check that all CI checks pass before tagging
- β Verify repository permissions and secrets
- β Review workflow logs for specific error details
- β
Ensure
GH_PATsecret is configured with admin permissions - β Check that the token has repository administration rights
- β Verify workflow dispatch permissions
graph TD
A[Developer Push] --> B{Branch Type?}
B -->|feature/*| C[CI Workflow]
B -->|release/*| D[CI + Auto-release]
B -->|main| E[CI + Tag Check]
F[Git Tag v*.*.*] --> G[Official Release]
H[Weekly Schedule] --> I[Auto-update]
J[Manual Trigger] --> K[Branch Protection]
C --> L[PR Review Process]
D --> M[Quick Development Release]
G --> N[Production Release]
L --> O[Merge Decision]
O --> P[Update Main Branch]
C --> Q[Integration Tests]
C --> R[Python Wrapper Tests]
Q --> S[GitHub API Validation]
R --> T[CLI Testing]
- Follow branch naming conventions (enforced by branch-name-check.yml)
- Ensure all CI checks pass before requesting review
- Use appropriate release strategy:
- Feature branches β Auto-release for development iterations
- Git tags β Official release for production deployments
- Review workflow changes carefully as they affect the entire team
- Test locally first: Run
poetry run pytestand linting before pushing
- π οΈ Use workflow utilities: Leverage
workflow_utils.shfunctions for consistent logging - π OIDC Publishing: No need to manage PyPI tokens - use trusted publishing
- π Smart Retries: Built-in exponential backoff handles transient failures automatically
- π¦ Cache Efficiency: Workflows now use optimized cache strategies for faster builds
- π‘οΈ Error Handling: Comprehensive error reporting with proper exit codes
- π§ͺ Integration Testing: Comprehensive end-to-end testing with real API integration
- π Python Validation: Specialized Python wrapper testing for CLI reliability
- Alpha/Beta releases: Use for testing and early feedback
- Release candidates: Use for final validation before stable
- Stable releases: Use for production deployments (now with OIDC security)
- Hotfix releases: Use for critical bug fixes
- π OIDC Benefits: Eliminates token rotation, reduces attack surface
- π Build Quality: Enhanced verification prevents corrupted releases
- π Cache Optimization: Regular cleanup maintains build performance
- π Logging Standards: Use centralized logging for better troubleshooting
- π‘οΈ API Testing: Regular GitHub API validation ensures compatibility
- π§ͺ Error Recovery: Comprehensive testing of failure scenarios
- Repository Main README
- Contributing Guidelines
- GitHub Actions Documentation
- Semantic Versioning Specification
- GitHub Actions Tab: Monitor all workflow runs
- Repository Settings: Configure branch protection manually if needed
- Security Tab: Review secret scanning results
- Insights Tab: View repository activity and workflow performance
After reviewing this documentation:
- Test the workflows: Create a test PR to verify CI workflow
- Practice releases: Try both auto-release and official release processes
- Monitor performance: Check GitHub Actions tab for workflow runs
- Customize as needed: Adapt workflows to your specific requirements
- Train your team: Share this documentation with contributors
The complete workflow suite provides robust automation for development, testing, and release processes while maintaining high quality and security standards! π
Last updated: October 27, 2025
Recent Updates: Modular Architecture, 28 Extracted Scripts, Integration Testing, Python Wrapper Testing
Maintained by: Repository maintainers