Skip to content

Prove Textual creation hooks under OrderPreservingReads & cache star-import scan #2728

Prove Textual creation hooks under OrderPreservingReads & cache star-import scan

Prove Textual creation hooks under OrderPreservingReads & cache star-import scan #2728

name: Integration Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
python-boundary-tests:
name: python-boundary-tests (${{ matrix.python-version }}, shard ${{ matrix.shard }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# 3.12 has no native creation contract, so it runs the SpanOnly
# backend that every uncontracted interpreter gets.
python-version: ["3.12", "3.14"]
# One runner has 4 cores; the suite needs about 3,000 CPU-seconds.
# The shard count in the pytest step is len(shard).
shard: [0, 1, 2, 3]
include:
# 3.14 traces coverage through sys.monitoring at about 2%.
- python-version: "3.12"
coverage: ""
- python-version: "3.14"
coverage: "--cov=nominal_refactor_advisor --cov-report="
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# tests/relocation_excerpts.py reads the historical relocations with git show.
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run test suite
run: python -m pytest tests/ --shard ${{ matrix.shard }}/4 ${{ matrix.coverage }} --tb=short --durations=20
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-python-${{ matrix.python-version }}-shard-${{ matrix.shard }}
path: .coverage
if-no-files-found: ignore
retention-days: 1
mypy-growth-gate:
# No file may gain mypy errors against the base commit. The baseline is the
# base commit's own run, computed here, not a committed list.
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Compare mypy errors per file against the base
env:
BASE_REF: ${{ github.event.pull_request.base.sha || github.event.before }}
run: |
if [ -z "$BASE_REF" ] || [ "$BASE_REF" = "0000000000000000000000000000000000000000" ]; then
BASE_REF=HEAD~1
fi
python .github/scripts/mypy_growth_gate.py --base-ref "$BASE_REF"
docs-and-wheel-smoke:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Build docs
run: python -m sphinx -E -b html docs/source docs/_build/html
- name: Build distribution artifacts
run: python -m build
- name: Smoke-test wheel install
run: |
python -m venv .venv-wheel
. .venv-wheel/bin/activate
python -m pip install --upgrade pip
pip install --force-reinstall dist/*.whl
tmpdir="$(mktemp -d)"
cd "$tmpdir"
python -m nominal_refactor_advisor --help
python - <<'PY'
import os
from pathlib import Path
from nominal_refactor_advisor.cli import analyze_path
workspace = Path(os.environ["GITHUB_WORKSPACE"])
findings = analyze_path(workspace / "nominal_refactor_advisor")
assert isinstance(findings, list)
print(f"wheel_smoke_findings={len(findings)}")
PY