Skip to content

Commit e899df3

Browse files
committed
Enhance CI Test to run tests against sqlalchemy 1.x and 2.x
1 parent 0d96c97 commit e899df3

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
matrix:
1515
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
1616
mongodb-version: ['7.0', '8.0']
17+
# Test against representative SQLAlchemy series (1.x and 2.x)
18+
sqlalchemy-version: ['1.4.*', '2.*']
1719

1820
services:
1921
mongodb:
@@ -41,9 +43,9 @@ jobs:
4143
uses: actions/cache@v3
4244
with:
4345
path: ~/.cache/pip
44-
key: ${{ runner.os }}-py${{ matrix.python-version }}-mongo${{ matrix.mongodb-version }}-pip-${{ hashFiles('**/requirements-test.txt', 'pyproject.toml') }}
46+
key: ${{ runner.os }}-py${{ matrix.python-version }}-mongo${{ matrix.mongodb-version }}-sqlalchemy-${{ matrix.sqlalchemy-version }}-pip-${{ hashFiles('**/requirements-test.txt', 'pyproject.toml') }}
4547
restore-keys: |
46-
${{ runner.os }}-py${{ matrix.python-version }}-mongo${{ matrix.mongodb-version }}-pip-
48+
${{ runner.os }}-py${{ matrix.python-version }}-mongo${{ matrix.mongodb-version }}-sqlalchemy-${{ matrix.sqlalchemy-version }}-pip-
4749
4850
- name: Install MongoDB shell
4951
run: |
@@ -55,6 +57,9 @@ jobs:
5557
- name: Install dependencies
5658
run: |
5759
python -m pip install --upgrade pip
60+
# Install the target SQLAlchemy version for this matrix entry first to ensure
61+
# tests run against both 1.x and 2.x series.
62+
pip install "SQLAlchemy==${{ matrix.sqlalchemy-version }}"
5863
pip install -r requirements-test.txt
5964
pip install black isort
6065

0 commit comments

Comments
 (0)