Skip to content

Commit 7f1c0e5

Browse files
committed
ci: update CI workflow to support multiple OS and SQLite checks
* Added matrix strategy for OS support (Linux, macOS, Windows) * Included installation steps for SQLite on each OS * Added version checks for SQLite to ensure compatibility
1 parent c2cdd92 commit 7f1c0e5

File tree

1 file changed

+59
-1
lines changed

1 file changed

+59
-1
lines changed

.github/workflows/test.yml

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: ubuntu-latest
11+
runs-on: ${{ matrix.os }}
1212
strategy:
1313
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
1415
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
1516

1617
steps:
@@ -21,6 +22,63 @@ jobs:
2122
with:
2223
python-version: ${{ matrix.python-version }}
2324

25+
- name: Install SQLite on Linux
26+
if: runner.os == 'Linux'
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y sqlite3 libsqlite3-dev
30+
31+
- name: Install SQLite on macOS
32+
if: runner.os == 'macOS'
33+
run: |
34+
brew update
35+
brew install sqlite
36+
# Ensure Homebrew sqlite is first on PATH for the job
37+
echo "PATH=$(brew --prefix sqlite)/bin:$PATH" >> $GITHUB_ENV
38+
39+
- name: Install SQLite on Windows
40+
if: runner.os == 'Windows'
41+
shell: powershell
42+
run: |
43+
choco install sqlite -y
44+
# Chocolatey puts sqlite3.exe in C:\ProgramData\chocolatey\bin which is on PATH
45+
46+
- name: Show sqlite version
47+
run: sqlite3 --version
48+
49+
- name: Assert sqlite >= 3.41 (Linux/macOS)
50+
if: runner.os != 'Windows'
51+
run: |
52+
python - <<'PY'
53+
import sys, subprocess
54+
try:
55+
out = subprocess.check_output(['sqlite3', '--version']).decode().split()[0]
56+
except Exception as e:
57+
print('Could not run sqlite3 --version:', e)
58+
sys.exit(1)
59+
parts = out.split('.')
60+
major = int(parts[0]) if len(parts) > 0 else 0
61+
minor = int(parts[1]) if len(parts) > 1 else 0
62+
if (major, minor) < (3, 41):
63+
print(f'Found sqlite {out}; sqlite >= 3.41 is required.')
64+
sys.exit(1)
65+
print('sqlite OK', out)
66+
PY
67+
68+
- name: Assert sqlite >= 3.41 (Windows)
69+
if: runner.os == 'Windows'
70+
shell: powershell
71+
run: |
72+
$ver = (sqlite3 --version).Split()[0]
73+
$parts = $ver.Split('.')
74+
$major = [int]$parts[0]
75+
$minor = [int]$parts[1]
76+
if ($major -lt 3 -or ($major -eq 3 -and $minor -lt 41)) {
77+
Write-Error "Found sqlite $ver; sqlite >= 3.41 is required."
78+
exit 1
79+
}
80+
Write-Host "sqlite OK $ver"
81+
2482
- name: Install dependencies
2583
run: |
2684
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)