Replace launch modal with clean, borderless professional enterprise i… #64
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: | |
| workflow_dispatch: | |
| inputs: | |
| run_live: | |
| description: "Run the live API smoke test (costs a real API call; needs OPENAI_API_KEY secret)" | |
| type: boolean | |
| default: false | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: py${{ matrix.python-version }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[dev]" | |
| # The core suite is hermetic: no network, no Ollama, no API keys. | |
| - name: Test (offline) | |
| env: | |
| GHOSTRUN_JUDGE: echo | |
| run: pytest tests -q | |
| # The example must skip cleanly rather than fail when no judge exists. | |
| - name: Example degrades gracefully without a judge | |
| env: | |
| GHOSTRUN_JUDGE: echo | |
| run: pytest examples -q | |
| # Replay must work with no network and no judge backend reachable. | |
| - name: Strict replay (no network, judge unreachable) | |
| env: | |
| GHOSTRUN_JUDGE_BASE_URL: http://localhost:59999 | |
| run: pytest examples -q --ghostrun-replay | |
| parallel: | |
| name: xdist parallel safety | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[dev]" pytest-xdist | |
| # The interceptor patches global httpx state; this guards against races. | |
| - name: Test under parallel workers | |
| env: | |
| GHOSTRUN_JUDGE: echo | |
| run: pytest tests -q -n 4 | |
| build: | |
| name: Build & verify package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Build | |
| run: | | |
| python -m pip install --upgrade pip build twine | |
| python -m build | |
| - name: Verify metadata | |
| run: python -m twine check dist/* | |
| - name: Install from wheel in a clean venv | |
| run: | | |
| python -m venv /tmp/fresh | |
| /tmp/fresh/bin/python -m pip install dist/*.whl | |
| /tmp/fresh/bin/python -c "import ghostrun; print('import ok', ghostrun.__version__)" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| live: | |
| name: Live API smoke test (opt-in) | |
| runs-on: ubuntu-latest | |
| # Only runs when manually dispatched with run_live=true, so PRs never spend | |
| # money or need a key. Requires an OPENAI_API_KEY repo secret. | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_live == 'true' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[dev]" openai | |
| - name: Record from the real API, then replay offline | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| GHOSTRUN_LIVE: "1" | |
| GHOSTRUN_JUDGE: echo # don't require Ollama in CI | |
| run: pytest examples/test_live_smoke.py -v |