mirror of
https://github.com/ollama/ollama-python.git
synced 2026-01-13 21:57:16 +08:00
ci: add matrix workflow including windows to catch platform-specific test flakes
This commit is contained in:
parent
5a426abeaf
commit
53ef1364aa
45
.github/workflows/ci-matrix.yml
vendored
Normal file
45
.github/workflows/ci-matrix.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
name: CI Matrix (including Windows)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
python-version: [3.11]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt || true
|
||||
- name: Run tests
|
||||
run: |
|
||||
# ensure a project-local temp dir to avoid AppData permission issues on Windows
|
||||
python - <<'PY'
|
||||
import os, pathlib
|
||||
p = pathlib.Path('tmp')
|
||||
p.mkdir(exist_ok=True)
|
||||
os.environ['TMP'] = str(p.resolve())
|
||||
os.environ['TEMP'] = str(p.resolve())
|
||||
print('TMP/TEMP set to', os.environ['TMP'])
|
||||
PY
|
||||
pytest --basetemp=tmp/pytest --cov --cov-branch --cov-report=xml
|
||||
- name: Upload coverage to Artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-xml-${{ matrix.os }}
|
||||
path: coverage.xml
|
||||
Loading…
Reference in New Issue
Block a user