ci: update CI workflow to support multiple OS and SQLite checks #43
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| 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'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install SQLite on Linux | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y sqlite3 libsqlite3-dev | |
| - name: Install SQLite on macOS | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew update | |
| brew install sqlite | |
| # Ensure Homebrew sqlite is first on PATH for the job | |
| echo "PATH=$(brew --prefix sqlite)/bin:$PATH" >> $GITHUB_ENV | |
| - name: Install SQLite on Windows | |
| if: runner.os == 'Windows' | |
| shell: powershell | |
| run: | | |
| choco install sqlite -y | |
| # Chocolatey puts sqlite3.exe in C:\ProgramData\chocolatey\bin which is on PATH | |
| - name: Show sqlite version | |
| run: sqlite3 --version | |
| - name: Assert sqlite >= 3.41 (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| run: | | |
| python - <<'PY' | |
| import sys, subprocess | |
| try: | |
| out = subprocess.check_output(['sqlite3', '--version']).decode().split()[0] | |
| except Exception as e: | |
| print('Could not run sqlite3 --version:', e) | |
| sys.exit(1) | |
| parts = out.split('.') | |
| major = int(parts[0]) if len(parts) > 0 else 0 | |
| minor = int(parts[1]) if len(parts) > 1 else 0 | |
| if (major, minor) < (3, 41): | |
| print(f'Found sqlite {out}; sqlite >= 3.41 is required.') | |
| sys.exit(1) | |
| print('sqlite OK', out) | |
| PY | |
| - name: Assert sqlite >= 3.41 (Windows) | |
| if: runner.os == 'Windows' | |
| shell: powershell | |
| run: | | |
| $ver = (sqlite3 --version).Split()[0] | |
| $parts = $ver.Split('.') | |
| $major = [int]$parts[0] | |
| $minor = [int]$parts[1] | |
| if ($major -lt 3 -or ($major -eq 3 -and $minor -lt 41)) { | |
| Write-Error "Found sqlite $ver; sqlite >= 3.41 is required." | |
| exit 1 | |
| } | |
| Write-Host "sqlite OK $ver" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install -r requirements-dev.txt | |
| - name: Lint with ruff | |
| run: ruff check . | |
| - name: Format check with ruff | |
| run: ruff format --check . | |
| - name: Type check with mypy | |
| run: mypy sqlite_vec_client/ | |
| - name: Test with pytest | |
| run: pytest --cov=sqlite_vec_client --cov-report=term |