Feat/pub prep #138
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: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| # Pinned to the ruff version in uv.lock. Bump both together. | |
| # `ruff format --check` is intentionally not gated yet (repo not format-clean). | |
| - name: Ruff lint | |
| run: uvx ruff@0.15.8 check | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: uv sync --all-extras | |
| - name: Type-check (ty) | |
| run: uv run ty check | |
| - name: Cache HuggingFace models | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/huggingface | |
| key: hf-${{ runner.os }}-${{ hashFiles('tests/conftest.py') }} | |
| restore-keys: hf-${{ runner.os }}- | |
| - name: Run tests | |
| env: | |
| # Optional — only needed if a fixture model is gated on HuggingFace. | |
| # Set this in repo Settings → Secrets if `google/gemma-3-270m-it` | |
| # or any other model used in tests requires gated access. | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: uv run pytest -v |