nanochat/.github/workflows/test.yml
2026-02-16 10:58:39 +03:00

46 lines
1.0 KiB
YAML

name: Test
on:
push:
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.10']
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v7
# Linux: Request 'cpu' extra to force the pytorch-cpu index (prevents libcublas crash)
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
uv sync --extra cpu
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
# macOS: Standard sync
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: uv sync
- name: Add nanochat to PYTHONPATH (Unix)
run: |
echo "PYTHONPATH=$(pwd):$PYTHONPATH" >> $GITHUB_ENV
- name: Run pytest
run: |
uv run pytest tests/