Skip to content

Tests: PyMongo

Tests: PyMongo #89

Workflow file for this run

---
name: "Tests: PyMongo"
on:
pull_request:
paths:
- '.github/workflows/pymongo.yml'
- 'cratedb_toolkit/adapter/pymongo/**'
- 'tests/adapter/*pymongo*'
- 'pyproject.toml'
push:
branches: [ main ]
paths:
- '.github/workflows/pymongo.yml'
- 'cratedb_toolkit/adapter/pymongo/**'
- 'tests/adapter/*pymongo*'
- 'pyproject.toml'
# Allow job to be triggered manually.
workflow_dispatch:
# Run the job each night after CrateDB nightly has been published.
schedule:
- cron: '0 3 * * *'
# Cancel in-progress jobs when pushing to the same branch.
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: [
"3.9",
"3.12",
]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
UV_SYSTEM_PYTHON: true
# Do not tear down Testcontainers
TC_KEEPALIVE: true
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers
services:
cratedb:
image: crate/crate:nightly
ports:
- 4200:4200
- 5432:5432
name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }}
steps:
- name: Acquire sources
uses: actions/checkout@v6
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
cache-dependency-glob: |
pyproject.toml
cache-suffix: ${{ matrix.python-version }}
enable-cache: true
version: "latest"
- name: Set up project
run: |
# Install package in editable mode.
uv pip install --editable=.[pymongo,test]
- name: Run software tests
run: |
pytest -m pymongo
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.xml
flags: pymongo
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true