fix(encoder): the provider-unavailable embed skip warns, and then throttles itself #422
Workflow file for this run
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, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| # Release 3.3.1 bumped pyproject.toml alone. Nothing here compared it to the | |
| # other version-bearing files, so the skew only surfaced in the release | |
| # workflow — after the tag existed, where the failure mode is a dead release | |
| # instead of a red PR. This job runs the same gate the release runs, on every | |
| # push and PR. It is stdlib-only and needs no install, so it costs ~10s. | |
| versions: | |
| name: Version Consistency | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Check every version-bearing file agrees | |
| run: python scripts/pre_ship.py --only versions | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install ruff | |
| # Pinned on purpose: an unpinned install makes Lint a moving target. ruff 0.16.0 | |
| # started reporting RUF100/RUF036 on files nobody had touched, so `main` and every | |
| # open PR went red on the same day without a single line of code changing. | |
| run: pip install ruff==0.16.0 | |
| - name: Run ruff check | |
| run: ruff check src/ tests/ | |
| - name: Run ruff format check | |
| run: ruff format --check src/ tests/ | |
| # Reads the source tree only — no install needed, and ruff cannot see | |
| # this class of dead code because a test importing a module counts as an | |
| # import. | |
| - name: Check for unreachable modules | |
| run: python scripts/check_dead_modules.py --strict | |
| typecheck: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: pip install -e ".[dev]" | |
| - name: Run mypy | |
| run: mypy src/ --ignore-missing-imports | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: pip install -e ".[dev,server]" | |
| - name: Run tests | |
| run: pytest tests/ -v --timeout=60 -n auto -m "not stress" --cov=surreal_memory --cov-report=xml --cov-report=term-missing --cov-fail-under=65 --dist worksteal | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.11' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| docs: | |
| name: Docs Freshness | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: pip install -e ".[dev,server]" | |
| - name: Check MCP docs are up-to-date | |
| run: python scripts/gen_mcp_docs.py --check | |
| - name: Check CLI docs are up-to-date | |
| run: python scripts/gen_cli_docs.py --check | |
| - name: Check config reference is up-to-date | |
| run: python scripts/gen_config_docs.py --check | |
| - name: Check REST reference is up-to-date | |
| run: python scripts/gen_api_docs.py --check | |
| # Counts scattered through prose (tool count, test count, schema version) | |
| # drift silently — nothing regenerates them. Exits non-zero on drift; | |
| # `python scripts/sync_refs.py --fix` rewrites them. | |
| - name: Check scattered references are up-to-date | |
| run: python scripts/sync_refs.py | |
| # mkdocs is not a project dependency — the site is built from these | |
| # plugins only. Strict mode turns every dead link into a failure, which | |
| # is the point: it had silently broken and nothing was running it. | |
| - name: Install docs toolchain | |
| run: pip install mkdocs-material mkdocs-mermaid2-plugin mkdocstrings-python mike | |
| - name: Build the docs site | |
| run: mkdocs build --strict | |
| security: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install ruff | |
| # Pinned on purpose: an unpinned install makes Lint a moving target. ruff 0.16.0 | |
| # started reporting RUF100/RUF036 on files nobody had touched, so `main` and every | |
| # open PR went red on the same day without a single line of code changing. | |
| run: pip install ruff==0.16.0 | |
| - name: Run security rules | |
| run: ruff check src/ --select S --ignore S101,S110,S112,S311,S324 | |
| integration: | |
| name: Integration (SurrealDB) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| env: | |
| SURREALDB_URL: http://127.0.0.1:8001 | |
| SURREALDB_USER: root | |
| SURREALDB_PASS: root | |
| SURREALDB_NS: smem_ci | |
| SURREALDB_DB: smem_ci | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| # `services:` can't run this: the image's ENTRYPOINT is `/surreal` with no | |
| # default CMD (no command == prints help and exits), and `services:` only | |
| # accepts `options:` (docker-create flags), never a container command. A | |
| # plain `docker run` step is the only way to pass the required `start …` | |
| # arguments. Command mirrors docker-compose.surrealdb.yml, minus the | |
| # persistence path: an in-memory datastore is enough for a run that's | |
| # thrown away afterward and needs no root-owned named volume. | |
| - name: Start SurrealDB | |
| run: | | |
| docker run -d --name surrealdb-ci -p 8001:8001 \ | |
| surrealdb/surrealdb:v3.2.0 \ | |
| start memory --user root --pass root --bind 0.0.0.0:8001 \ | |
| --allow-experimental gql --allow-eval-query | |
| - name: Wait for SurrealDB to be ready | |
| run: | | |
| for _ in $(seq 1 30); do | |
| if docker exec surrealdb-ci /surreal isready --endpoint http://localhost:8001; then | |
| exit 0 | |
| fi | |
| sleep 1 | |
| done | |
| echo "SurrealDB did not become ready in time" | |
| docker logs surrealdb-ci | |
| exit 1 | |
| - name: Install dependencies | |
| run: pip install -e ".[dev,server,surrealdb]" | |
| # No -n auto here: parallel workers hammering one shared SurrealDB | |
| # connection produce connection resets under load unrelated to any real | |
| # regression. Correctness, not speed, is the point of this job. | |
| - name: Run tests against a live SurrealDB | |
| run: pytest tests/ -v --timeout=120 -m "not stress" | |
| - name: SurrealDB logs (on failure) | |
| if: failure() | |
| run: docker logs surrealdb-ci | |
| build: | |
| name: Build Package | |
| runs-on: ubuntu-latest | |
| needs: [versions, lint, typecheck, test] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: dashboard/package-lock.json | |
| - name: Test dashboard | |
| working-directory: dashboard | |
| run: npm ci && npm run test | |
| - name: Build dashboard | |
| working-directory: dashboard | |
| run: npm run build | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install build tools | |
| run: pip install build | |
| - name: Build package | |
| run: python -m build | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ |