From ccbdd963f273c57d951e6e7d967cadf3ebeac1ed Mon Sep 17 00:00:00 2001 From: Sermet Pekin <96650846+SermetPekin@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:57:44 +0300 Subject: [PATCH] Add 'gh-wf' branch to workflow triggers --- .github/workflows/base.yml | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/base.yml diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml new file mode 100644 index 0000000..4202de0 --- /dev/null +++ b/.github/workflows/base.yml @@ -0,0 +1,79 @@ +name: Test + +on: + push: + branches: + - master + - dev + - mac + - gh-wf + pull_request: + branches: + - master + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ['3.9' , '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: Install uv + run: | + python -m pip install uv + + - name: Create virtual environment with uv + run: | + uv venv .venv + + - name: Activate virtual environment (Unix) + if: runner.os != 'Windows' + run: | + source .venv/bin/activate + + - name: Activate virtual environment (Windows) + if: runner.os == 'Windows' + run: | + .venv\Scripts\activate + + - name: Install dependencies with uv + run: | + uv pip install transformers>=4.0.0 + uv pip install . --system + + - 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: Install pytest + run: | + python -m pip install pytest + + - name: Run pytest + run: | + python -m pytest tests/ --maxfail=5 --disable-warnings + + - name: Cache pip dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-pip-