Refactor CI workflow to use 'uv' commands

Updated GitHub Actions workflow to use 'uv' for setup and dependency management.
This commit is contained in:
Sermet Pekin 2025-10-22 13:50:35 +03:00 committed by Sermet Pekin
parent 5eeb2b6ef9
commit 46659d1009

50
base.yml Normal file
View File

@ -0,0 +1,50 @@
name: Test
on:
push:
branches:
- master
- gh-wf-v3
pull_request:
branches:
- master
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies with uv
run: |
uv sync
uv pip install transformers>=4.0.0
- name: Add nanochat to PYTHONPATH (Unix)
if: runner.os != 'Windows'
run: |
echo "PYTHONPATH=$(pwd):$PYTHONPATH" >> $GITHUB_ENV
- name: Add nanochat to PYTHONPATH (Windows)
if: runner.os == 'Windows'
run: |
echo "PYTHONPATH=$PWD;$env:PYTHONPATH" >> $env:GITHUB_ENV
- name: Run pytest
run: |
uv run pytest tests/ --maxfail=5