release: 0.1.7 — static-response cache (Wave 4, 7.5x plaintext speedu… #22
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --extra dev --extra pydantic | |
| - name: Run tests with coverage | |
| # Exclude tests/perf — those run in the dedicated memory-check job. | |
| run: uv run pytest tests/ --ignore=tests/perf --cov=hawkapi --cov-report=xml -q | |
| - name: Upload coverage | |
| if: matrix.python-version == '3.13' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: coverage.xml | |
| fail_ci_if_error: false | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: uv sync --extra dev --extra pydantic | |
| - name: Ruff check | |
| run: uv run ruff check src/ tests/ | |
| - name: Ruff format check | |
| run: uv run ruff format --check src/ tests/ | |
| typecheck: | |
| name: Type check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: uv sync --extra dev --extra pydantic --extra uvicorn --extra metrics --extra logging | |
| - name: Pyright | |
| run: uv run pyright src/ | |
| memory-check: | |
| name: Memory Budget Check | |
| # pytest-memray supports Linux and macOS only — never run on Windows. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python 3.13 | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: uv sync --extra dev | |
| - name: Run memory budget tests | |
| run: uv run pytest tests/perf/ -m memory --memray --memray-bin-path=/tmp -v | |
| - name: Upload memray binary artefacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: memray-bin | |
| path: /tmp/*.bin | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| perf-regression: | |
| name: Performance Regression Gate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Need history so the committed baseline JSON is available. | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python 3.13 | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: uv sync --extra dev | |
| - name: Run performance regression tests | |
| # Compares each benchmark's mean against the committed baseline and | |
| # fails the job if any hot path regresses by more than 5%. | |
| run: | | |
| uv run pytest tests/perf/ -m perf --benchmark-only \ | |
| --benchmark-compare=tests/perf/.benchmark_baseline.json \ | |
| --benchmark-compare-fail=mean:5% \ | |
| --benchmark-columns=min,mean,median,stddev,rounds | |
| - name: Upload benchmark artefacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: perf-benchmarks | |
| path: .benchmarks/ | |
| if-no-files-found: ignore | |
| retention-days: 30 | |
| test-free-threaded: | |
| name: Test (Python 3.13 free-threaded, experimental) | |
| # Non-blocking: surfaces regressions without gating merges. | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python 3.13 free-threaded | |
| # uv supports the free-threaded CPython build via the 't' suffix. | |
| run: uv python install 3.13t | |
| - name: Verify interpreter is actually free-threaded | |
| # Fail fast if `uv python install 3.13t` silently resolved to a | |
| # GIL-enabled 3.13 interpreter. Without this guard the rest of the | |
| # job would still pass but for the wrong reason. | |
| run: uv run --python 3.13t python -c "import sys; assert not sys._is_gil_enabled(), 'expected no-GIL interpreter'" | |
| - name: Install dependencies | |
| run: uv sync --python 3.13t --extra dev --extra pydantic | |
| - name: Run unit tests | |
| run: uv run --python 3.13t pytest tests/unit -x --tb=short -q |