|
| 1 | +# GitHub Workflows |
| 2 | + |
| 3 | +This directory contains the modernized GitHub Actions workflows for the mlscorecheck project. |
| 4 | + |
| 5 | +## Workflows Overview |
| 6 | + |
| 7 | +### 1. **Build & Test** (`build.yml`) |
| 8 | +**Triggers:** Push/PR to main/develop branches |
| 9 | + |
| 10 | +**Features:** |
| 11 | +- **Code Quality**: Linting with flake8 |
| 12 | +- **Multi-platform Testing**: Ubuntu, Windows, macOS |
| 13 | +- **Multi-version Testing**: Python 3.10, 3.11, 3.12, 3.13 |
| 14 | +- **Coverage Reporting**: Integrated with Codecov |
| 15 | +- **Build Artifacts**: Uploads wheel and source distribution |
| 16 | +- **Concurrency Control**: Cancels redundant runs |
| 17 | + |
| 18 | +**Jobs:** |
| 19 | +1. `lint` - Code quality checks |
| 20 | +2. `test` - Cross-platform testing with coverage |
| 21 | +3. `build` - Package building and artifact upload |
| 22 | + |
| 23 | +### 2. **Release** (`release.yml`) |
| 24 | +**Triggers:** GitHub releases or manual dispatch |
| 25 | + |
| 26 | +**Features:** |
| 27 | +- **Trusted Publishing**: Secure PyPI publishing without tokens |
| 28 | +- **Test PyPI Support**: Option to publish to test environment |
| 29 | +- **Release Validation**: Runs tests before publishing |
| 30 | +- **GitHub Assets**: Automatically uploads wheels to releases |
| 31 | +- **Dual Environment**: Supports both PyPI and Test PyPI |
| 32 | + |
| 33 | +**Jobs:** |
| 34 | +1. `validate-release` - Pre-publish validation |
| 35 | +2. `build-and-publish` - Build and publish to PyPI |
| 36 | +3. `create-github-release-assets` - Upload to GitHub releases |
| 37 | + |
| 38 | +### 3. **Documentation** (`docs.yml`) |
| 39 | +**Triggers:** Changes to docs/ or mlscorecheck/ directories |
| 40 | + |
| 41 | +**Features:** |
| 42 | +- **Sphinx Documentation**: Builds HTML documentation |
| 43 | +- **Warning Detection**: Fails on warnings/errors |
| 44 | +- **Artifact Upload**: Stores built docs as artifacts |
| 45 | +- **Path-based Triggers**: Only runs when relevant files change |
| 46 | + |
| 47 | +**Jobs:** |
| 48 | +1. `build-docs` - Build and validate documentation |
| 49 | + |
| 50 | +## Key Improvements |
| 51 | + |
| 52 | +### Security |
| 53 | +- **Trusted Publishing**: Uses OIDC tokens instead of API keys |
| 54 | +- **Environment Protection**: Release jobs require approval |
| 55 | +- **Minimal Permissions**: Only grants necessary permissions |
| 56 | + |
| 57 | +### Performance |
| 58 | +- **Concurrency Control**: Cancels redundant workflow runs |
| 59 | +- **Conditional Execution**: Docs only build when needed |
| 60 | +- **Artifact Caching**: Efficient dependency management |
| 61 | + |
| 62 | +### Maintainability |
| 63 | +- **Modern Actions**: Uses latest action versions (v4, v5) |
| 64 | +- **Clear Job Names**: Descriptive and organized |
| 65 | +- **Fail-Fast Strategy**: Quick feedback on failures |
| 66 | +- **Comprehensive Testing**: Multiple OS and Python versions |
| 67 | + |
| 68 | +### Developer Experience |
| 69 | +- **Manual Dispatch**: Test releases manually |
| 70 | +- **Clear Feedback**: Detailed job names and status |
| 71 | +- **Artifact Downloads**: Easy access to build outputs |
| 72 | +- **Path-based Triggers**: Reduced unnecessary runs |
| 73 | + |
| 74 | +## Migration Notes |
| 75 | + |
| 76 | +The new workflows replace the previous files: |
| 77 | +- ❌ `pythonpackage.yml` → ✅ `build.yml` |
| 78 | +- ❌ `pythonpublish.yml` → ✅ `release.yml` |
| 79 | +- ❌ `codecov.yml` → ✅ Integrated into `build.yml` |
| 80 | + |
| 81 | +All functionality is preserved while adding modern best practices and improved organization. |
0 commit comments