name: Test on: push: branches: - master pull_request: branches: - master workflow_dispatch: 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 --extra cpu pytest tests/ -v