Skip to content

Add tests for min dependencies and update test matrix for min and max server versions #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 37 additions & 9 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ defaults:
shell: bash -eux {0}

env:
MONGODB_VERSION: "7.0"
MIN_PYTHON: "3.9"
MIN_MONGODB: "4.0"
MAX_MONGODB: "8.0"

jobs:
static:
Expand Down Expand Up @@ -55,18 +57,16 @@ jobs:
- uses: extractions/setup-just@v2
- name: Start MongoDB on Linux
if: ${{ startsWith(runner.os, 'Linux') }}
run: |
docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:${MONGODB_VERSION} mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5
until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
sleep 1
done
sudo docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "rs.initiate({\"_id\":\"rs\",\"members\":[{\"_id\":0,\"host\":\"127.0.0.1:27017\" }]})"
uses: supercharge/[email protected]
with:
mongodb-version: ${{ env.MAX_MONGODB }}
mongodb-replica-set: test-rs
- name: Start MongoDB on MacOS
if: ${{ startsWith(runner.os, 'macOS') }}
run: |
brew tap mongodb/brew
brew install mongodb/brew/mongodb-community@${MONGODB_VERSION}
brew services start mongodb-community@${MONGODB_VERSION}
brew install mongodb/brew/mongodb-community@${MAX_MONGODB}
brew services start mongodb-community@${MAX_MONGODB}
- name: Start MongoDB on Windows
if: ${{ startsWith(runner.os, 'Windows') }}
shell: powershell
Expand All @@ -77,3 +77,31 @@ jobs:
net start MongoDB
- run: just install
- run: just test

build-min:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ env.MIN_PYTHON }}
- uses: extractions/setup-just@v2
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ env.MIN_PYTHON }}
- uses: extractions/setup-just@v2
- uses: supercharge/[email protected]
with:
mongodb-version: ${{ env.MIN_MONGODB }}
mongodb-replica-set: test-rs
- name: Run unit tests with minimum dependency versions
run: |
uv sync --python=${MIN_PYTHON} --resolution=lowest-direct
just test
Loading