Skip to content

Fix #94 fastapi compat #77

Fix #94 fastapi compat

Fix #94 fastapi compat #77

# Release checks
#
# Use this to ensure your package is ready for release by running comprehensive
# pre-release validation including build, installation, and functionality tests.
#
# This workflow runs the nox release-check session which includes:
# - Git status validation
# - Code formatting and linting
# - Full test suite
# - Package building
# - Installation testing
name: release-check
on:
push:
branches:
- main
- dev
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch: # Allow manual triggering
jobs:
release-check:
timeout-minutes: 60
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- name: Set OS Environment Variables (Windows)
if: runner.os == 'Windows'
run: |
echo 'ACTIVATE_PYTHON_VENV=.venv/scripts/activate' >> $GITHUB_ENV
- name: Set OS Environment Variables (not Windows)
if: runner.os != 'Windows'
run: |
echo 'ACTIVATE_PYTHON_VENV=.venv/bin/activate' >> $GITHUB_ENV
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for git checks
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y cppcheck clang-format
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install cppcheck
brew install clang-format
- name: Install system dependencies (Windows)
if: runner.os == 'Windows'
run: |
choco install cppcheck
choco install llvm --yes # This includes clang-format
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Install dependencies
run: |
uv sync --group dev
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit/
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run release checks
env:
PYTHONWARNINGS: ignore
run: |
uv run nox -s release-check
- name: Upload build artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist/
retention-days: 7
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}-py${{ matrix.python-version }}
path: |
.coverage
htmlcov/
retention-days: 7
if-no-files-found: ignore
# Summary job that depends on all matrix jobs
release-check-summary:
needs: release-check
runs-on: ubuntu-latest
if: always()
steps:
- name: Check release readiness
run: |
if [[ "${{ needs.release-check.result }}" == "success" ]]; then
echo "✅ All release checks passed! Package is ready for release."
echo "::notice title=Release Ready::All pre-release validation checks have passed successfully."
else
echo "❌ Release checks failed. Please review the errors above."
echo "::error title=Release Not Ready::Some pre-release validation checks have failed."
exit 1
fi