Skip to content

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

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

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

Workflow file for this run

name: Python Tests
on:
push:
branches: ["main"]
pull_request:
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -eux {0}
jobs:
static:
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: ${{ matrix.python-version }}
- uses: extractions/setup-just@v2
- run: just install
- run: just lint
- run: just docs
- run: just doctest
build:
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"]
fail-fast: false
name: CPython ${{ matrix.python-version }}-${{ matrix.os }}
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: ${{ matrix.python-version }}
- uses: extractions/setup-just@v2
- name: Start MongoDB on Linux
if: ${{ startsWith(runner.os, 'Linux') }}
uses: supercharge/[email protected]
with:
mongodb-version: 8.0
mongodb-replica-set: test-rs
- name: Start MongoDB on MacOS
if: ${{ startsWith(runner.os, 'macOS') }}
run: |
brew tap mongodb/brew
brew install mongodb/brew/[email protected]
brew services start [email protected]
- name: Start MongoDB on Windows
if: ${{ startsWith(runner.os, 'Windows') }}
shell: powershell
run: |
mkdir data
mongod --remove
mongod --install --dbpath=$(pwd)/data --logpath=$PWD/mongo.log
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: "3.9"
- uses: extractions/setup-just@v2
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.9"
- uses: extractions/setup-just@v2
- uses: supercharge/[email protected]
with:
mongodb-version: 4.0
mongodb-replica-set: test-rs
- name: Run unit tests with minimum dependency versions
run: |
uv sync --python="3.9" --resolution=lowest-direct
just tests