|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + schedule: |
| 9 | + - cron: "23 4 * * 1" |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +env: |
| 19 | + UV_VERSION: 0.11.8 |
| 20 | + |
| 21 | +jobs: |
| 22 | + quality: |
| 23 | + name: Offline quality and workflow checks |
| 24 | + runs-on: ubuntu-latest |
| 25 | + timeout-minutes: 20 |
| 26 | + steps: |
| 27 | + - name: Check out the candidate |
| 28 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 29 | + - name: Set up Python |
| 30 | + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 31 | + with: |
| 32 | + python-version: "3.14" |
| 33 | + - name: Install the pinned uv frontend |
| 34 | + run: python -m pip install --disable-pip-version-check "uv==$UV_VERSION" |
| 35 | + - name: Check lock consistency |
| 36 | + run: uv lock --check |
| 37 | + - name: Reproduce the locked environment |
| 38 | + run: uv sync --locked |
| 39 | + - name: Lint |
| 40 | + run: uv run ruff check src tests scripts |
| 41 | + - name: Check formatting |
| 42 | + run: uv run ruff format --check src tests scripts |
| 43 | + - name: Type check |
| 44 | + run: uv run pyright |
| 45 | + - name: Run offline unit and contract tests |
| 46 | + run: uv run pytest -m "not live" |
| 47 | + - name: Check release version agreement |
| 48 | + run: uv run python scripts/check_version.py --expected 0.1.0a1 --require-changelog |
| 49 | + - name: Check canonical public content and identity |
| 50 | + run: uv run python scripts/check_version.py --require-public-preview-docs |
| 51 | + - name: Scan for credentials and scope mistakes |
| 52 | + run: uv run python scripts/check_secrets.py |
| 53 | + - name: Validate workflow syntax with checksum-pinned actionlint |
| 54 | + run: uv run python scripts/run_actionlint.py |
| 55 | + - name: Verify release-workflow trust semantics |
| 56 | + run: uv run python scripts/check_workflows.py |
| 57 | + |
| 58 | + locked-runtime: |
| 59 | + name: Locked dependencies / Python ${{ matrix.python-version }} |
| 60 | + runs-on: ubuntu-latest |
| 61 | + timeout-minutes: 20 |
| 62 | + strategy: |
| 63 | + fail-fast: false |
| 64 | + matrix: |
| 65 | + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 66 | + steps: |
| 67 | + - name: Check out the candidate |
| 68 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 69 | + - name: Set up Python |
| 70 | + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 71 | + with: |
| 72 | + python-version: ${{ matrix.python-version }} |
| 73 | + - name: Install the pinned uv frontend |
| 74 | + run: python -m pip install --disable-pip-version-check "uv==$UV_VERSION" |
| 75 | + - name: Reproduce the locked environment |
| 76 | + run: uv sync --locked |
| 77 | + - name: Run offline tests |
| 78 | + run: uv run pytest -m "not live" |
| 79 | + |
| 80 | + minimum-openai: |
| 81 | + name: Minimum OpenAI / Python 3.10 |
| 82 | + runs-on: ubuntu-latest |
| 83 | + timeout-minutes: 20 |
| 84 | + steps: |
| 85 | + - name: Check out the candidate |
| 86 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 87 | + - name: Set up Python |
| 88 | + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 89 | + with: |
| 90 | + python-version: "3.10" |
| 91 | + - name: Install the pinned uv frontend |
| 92 | + run: python -m pip install --disable-pip-version-check "uv==$UV_VERSION" |
| 93 | + - name: Create the development environment |
| 94 | + run: uv sync --locked |
| 95 | + - name: Select the minimum supported OpenAI dependency |
| 96 | + run: uv pip install --python .venv/bin/python "openai==2.45.0" |
| 97 | + - name: Run offline tests without resyncing the lock |
| 98 | + run: uv run --no-sync pytest -m "not live" |
| 99 | + |
| 100 | + latest-openai: |
| 101 | + name: Latest OpenAI within major canary |
| 102 | + if: github.event_name == 'schedule' || github.actor == 'dependabot[bot]' |
| 103 | + runs-on: ubuntu-latest |
| 104 | + timeout-minutes: 20 |
| 105 | + steps: |
| 106 | + - name: Check out the candidate |
| 107 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 108 | + - name: Set up Python |
| 109 | + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 110 | + with: |
| 111 | + python-version: "3.14" |
| 112 | + - name: Install the pinned uv frontend |
| 113 | + run: python -m pip install --disable-pip-version-check "uv==$UV_VERSION" |
| 114 | + - name: Create the development environment |
| 115 | + run: uv sync --locked |
| 116 | + - name: Select latest OpenAI within the supported major |
| 117 | + run: uv pip install --python .venv/bin/python --upgrade "openai>=2.45.0,<3.0.0" |
| 118 | + - name: Run canary tests without resyncing the lock |
| 119 | + run: uv run --no-sync pytest -m "not live" |
| 120 | + |
| 121 | + package: |
| 122 | + name: Build, inspect, and clean-install exact artifacts |
| 123 | + needs: [quality, locked-runtime, minimum-openai] |
| 124 | + runs-on: ubuntu-latest |
| 125 | + timeout-minutes: 25 |
| 126 | + steps: |
| 127 | + - name: Check out the candidate |
| 128 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 129 | + - name: Set up Python |
| 130 | + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 131 | + with: |
| 132 | + python-version: "3.14" |
| 133 | + - name: Install the pinned uv frontend |
| 134 | + run: python -m pip install --disable-pip-version-check "uv==$UV_VERSION" |
| 135 | + - name: Reproduce the locked environment |
| 136 | + run: uv sync --locked |
| 137 | + - name: Build wheel and source distribution |
| 138 | + run: uv build |
| 139 | + - name: Check package metadata rendering |
| 140 | + run: uv run twine check dist/* |
| 141 | + - name: Inspect artifact identity and shape |
| 142 | + run: uv run python scripts/check_artifacts.py dist/* |
| 143 | + - name: Install and smoke-test each exact artifact |
| 144 | + run: uv run python scripts/check_clean_install.py dist/* |
| 145 | + - name: Record immutable artifact digests |
| 146 | + run: sha256sum dist/* > artifact-sha256.txt |
| 147 | + - name: Retain verified artifacts |
| 148 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 149 | + with: |
| 150 | + name: python-distributions |
| 151 | + path: | |
| 152 | + dist/* |
| 153 | + artifact-sha256.txt |
| 154 | + if-no-files-found: error |
| 155 | + retention-days: 7 |
| 156 | + |
| 157 | + standalone: |
| 158 | + name: Standalone copied-checkout verification |
| 159 | + needs: package |
| 160 | + runs-on: ubuntu-latest |
| 161 | + timeout-minutes: 35 |
| 162 | + steps: |
| 163 | + - name: Check out the candidate |
| 164 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 165 | + - name: Set up Python |
| 166 | + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 167 | + with: |
| 168 | + python-version: "3.14" |
| 169 | + - name: Install the pinned uv frontend |
| 170 | + run: python -m pip install --disable-pip-version-check "uv==$UV_VERSION" |
| 171 | + - name: Verify from a copied standalone repository |
| 172 | + run: python scripts/check_repository_independence.py |
0 commit comments