Continuous Integration
This document covers the Continuous Integration (CI) workflows used to test and validate the reusable GitHub Actions workflows in this project.
Overviewโ
The CI system tests the reusable workflows themselves by running them against sample Python projects. All CI workflows follow the naming convention test-*.yml or test_*.yaml.
CI Test Workflowsโ
The project includes the following test workflows to validate the reusable workflows:
๐งช Testing Workflowsโ
1. test_python_project_ci_multi-tests.yamlโ
Tests Python projects using pip/setup.py with multiple test types.
Triggers:
- Push/PR to master when relevant files change
- Tests workflows:
rw_get_tests,rw_run_test,rw_run_test_with_multi_py_versions - Tests coverage:
rw_organize_test_cov_reports,rw_upload_test_cov_report - Tests quality:
rw_sonarqube_scan - Tests deployment:
rw_pre-building_test
What it validates:
- Multi-test type execution (unit, integration, etc.)
- Coverage report generation and upload
- SonarQube integration
- Pre-deployment testing
2. test_python_project_ci_one-test.yamlโ
Tests Python projects with a single test type using pip/setup.py.
What it validates:
- Single test type execution
- Basic CI workflow functionality
- Test discovery and execution
3. test_pyproject_ci_multi-tests_by_poetry.yamlโ
Tests Poetry-based Python projects with multiple test types.
Triggers:
- Push/PR to master when relevant files change
- Tests workflows:
rw_get_tests,rw_poetry_run_test,rw_poetry_run_test_with_multi_py_versions - Tests coverage and quality workflows
What it validates:
- Poetry dependency management
- Multi-version testing with Poetry
- Poetry-specific workflow features
4. test_nested_pyproject_ci_multi-tests_by_poetry.yamlโ
Tests nested Poetry projects (projects within subdirectories).
What it validates:
- Nested project structure support
- Working directory configuration
- Poetry in non-root directories
๐ Deployment & Release Workflowsโ
5. test_checking_deployment_ci.yamlโ
End-to-end test for deployment state checking.
What it validates:
rw_checking_deployment_stateworkflow- Version change detection
- Deployment decision logic
6. test_gh_reusable_workflow.yamlโ
Tests GitHub Action reusable workflow project CI.
What it validates:
rw_build_git-tag_and_create_github-releaseworkflow- Git tag creation
- GitHub release creation
- Branch deployment logic
7. test-release-validate.ymlโ
Dry-run validation of the release process.
Triggers:
- Pull requests to master affecting release files
- Manual workflow dispatch with configuration options
What it validates:
- Release intent configuration
- Python package validation
- Docker image validation
- Documentation validation
- Multi-artifact release coordination
8. test-release-staging.ymlโ
Tests the staging release workflow.
What it validates:
- Staging release process
- Pre-production deployment
- Release artifact generation
Workflow Architectureโ
Common Trigger Patternsโ
All test workflows follow similar trigger patterns:
Push/Pull Request Triggers:
on:
push:
branches:
- "master"
paths:
- ".github/workflows/test_*.yaml"
- ".github/workflows/rw_*.yaml"
- "test/**"
- "scripts/ci/**"
pull_request:
branches:
- "master"
paths:
- # Same paths as push
Benefits:
- โ Only runs when relevant files change
- โ Tests both push and PR scenarios
- โ Validates workflow changes before merge
- โ Ensures reusable workflows work correctly
Best Practicesโ
Testing Reusable Workflowsโ
- Test Against Real Scenarios: Each test workflow uses actual sample projects to validate functionality
- Path-Based Triggers: Only run tests when relevant files change to save CI resources
- Comprehensive Validation: Test multiple project types (pip, Poetry, nested)
- Output Verification: Validate workflow outputs match expected results
Adding New Test Workflowsโ
When creating new test workflows:
- Follow the naming convention:
test_*.yamlortest-*.yml - Include path-based triggers for efficiency
- Test both push and PR scenarios
- Validate workflow outputs
- Document what the test validates
Navigationโ
- ๐ CI/CD Overview - Return to main CI/CD hub
- ๐ Release System - Learn about releases and deployment
- ๐ Documentation Deployment - Documentation workflows
- ๐ ๏ธ Developer Guide - Configuration and troubleshooting