fix: handle lone Unicode surrogates in artifact persistence #111
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: ["**"] | |
| pull_request: | |
| # Cancel in-progress runs when a new commit is pushed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests-and-typecheck: | |
| name: Tests & Type Check | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Create venv and install dependencies | |
| run: | | |
| uv venv .venv | |
| # Install CPU-only PyTorch first (saves ~5GB, much faster) | |
| uv pip install --python .venv/bin/python torch --index-url https://download.pytorch.org/whl/cpu | |
| # Install open-webui and project dependencies | |
| uv pip install --python .venv/bin/python open-webui -e . | |
| uv pip install --python .venv/bin/python pytest pytest-asyncio pyright cairosvg pyzipper aioresponses ruff | |
| - name: Lint source code | |
| run: | | |
| source .venv/bin/activate | |
| ruff check open_webui_openrouter_pipe/ | |
| - name: Build monolith bundles | |
| run: | | |
| source .venv/bin/activate | |
| python scripts/bundle_v2.py | |
| python scripts/bundle_v2.py --compress | |
| - name: Lint bundles | |
| run: | | |
| source .venv/bin/activate | |
| ruff check open_webui_openrouter_pipe_bundled.py | |
| ruff check --per-file-ignores '*_compressed.py:E402' open_webui_openrouter_pipe_bundled_compressed.py | |
| - name: Type-check source and bundles | |
| run: | | |
| source .venv/bin/activate | |
| pyright | |
| pyright open_webui_openrouter_pipe_bundled.py | |
| pyright open_webui_openrouter_pipe_bundled_compressed.py | |
| - name: Run tests | |
| run: | | |
| source .venv/bin/activate | |
| python -m compileall open_webui_openrouter_pipe tests filters open_webui_openrouter_pipe_bundled.py open_webui_openrouter_pipe_bundled_compressed.py | |
| # Run the test suite in 3 modes: | |
| # 1) Normal package imports (on-disk modules) | |
| # 2) Bundled flat monolith | |
| # 3) Bundled compressed monolith | |
| echo "==> pytest (package imports)" | |
| PYTHONPATH=. pytest tests -q | |
| echo "==> pytest (bundled flat: open_webui_openrouter_pipe_bundled.py)" | |
| OWUI_PIPE_BUNDLE_PATH=open_webui_openrouter_pipe_bundled.py PYTHONPATH=. pytest tests -q | |
| echo "==> pytest (bundled compressed: open_webui_openrouter_pipe_bundled_compressed.py)" | |
| OWUI_PIPE_BUNDLE_PATH=open_webui_openrouter_pipe_bundled_compressed.py PYTHONPATH=. pytest tests -q |