Pre-Release Validation #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Pre-Release Validation | |
| # This workflow mimics the manual test_release.sh script | |
| # Run it before creating a release to validate everything works | |
| on: | |
| workflow_dispatch: # Manual trigger only | |
| push: | |
| tags: | |
| - 'v*' # Trigger on version tags | |
| jobs: | |
| pre-release-validation: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ["3.10", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Display environment info | |
| run: | | |
| echo "==========================================" | |
| echo "Pre-Release Validation" | |
| echo "==========================================" | |
| python --version | |
| python -c "import sys; print(f'Python path: {sys.executable}')" | |
| - name: Install development dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev,gpu]" | |
| - name: Auto-format code | |
| run: | | |
| echo "→ Auto-formatting code with isort and black..." | |
| isort smoltrace tests | |
| black smoltrace tests | |
| echo "✓ Code formatting applied" | |
| - name: Run full test suite with 100% coverage requirement | |
| run: | | |
| echo "→ Running tests with 100% coverage requirement..." | |
| pytest tests/ -v --cov=smoltrace --cov-report=term --cov-report=html --cov-report=term-missing --cov-fail-under=100 | |
| echo "✓ All tests passed with 100% coverage" | |
| - name: Code quality checks | |
| run: | | |
| echo "→ Running code quality checks..." | |
| black --check smoltrace tests | |
| isort --check-only smoltrace tests | |
| ruff check smoltrace tests | |
| pylint smoltrace --rcfile=.pylintrc --exit-zero || true | |
| echo "✓ Code quality checks complete" | |
| - name: Build package | |
| run: | | |
| echo "→ Building package..." | |
| pip install build twine | |
| python -m build | |
| echo "✓ Package built successfully" | |
| - name: Check package with twine | |
| run: | | |
| echo "→ Checking package with twine..." | |
| twine check dist/* | |
| echo "✓ Package check passed" | |
| - name: Test installation in isolated environment | |
| shell: bash | |
| run: | | |
| echo "→ Testing installation in temporary environment..." | |
| # Create temporary virtual environment | |
| python -m venv test_release_env | |
| # Activate based on OS | |
| if [[ "$RUNNER_OS" == "Windows" ]]; then | |
| source test_release_env/Scripts/activate | |
| else | |
| source test_release_env/bin/activate | |
| fi | |
| # Install the built wheel | |
| pip install dist/*.whl | |
| # Test imports | |
| python -c 'import smoltrace; print(f"Successfully imported smoltrace version: {smoltrace.__version__}")' | |
| python -c 'from smoltrace.cli import main; print("All core components imported successfully")' | |
| # Test CLI tool | |
| smoltrace-eval --help > /dev/null 2>&1 | |
| echo "✓ CLI tool works" | |
| # Cleanup | |
| deactivate | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' | |
| with: | |
| name: dist-packages | |
| path: dist/ | |
| - name: Summary | |
| if: success() | |
| run: | | |
| echo "" | |
| echo "==========================================" | |
| echo "✓ All Pre-Release Checks Passed!" | |
| echo "==========================================" | |
| echo "" | |
| echo "Release Checklist:" | |
| echo "✅ All tests passing with 100% coverage" | |
| echo "✅ Code formatting applied" | |
| echo "✅ Import sorting applied" | |
| echo "✅ Package builds successfully" | |
| echo "✅ Installation tested" | |
| echo "✅ CLI tool works" | |
| echo "" | |
| echo "Ready for release! 🚀" |