Skip to content

[pre-commit.ci] pre-commit autoupdate #106

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #106

Workflow file for this run

name: build
on:
push:
branches: ["main"]
tags: ["*"]
pull_request:
jobs:
docs:
name: docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.13"
- run: pip install tox
- run: tox -e docs
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { name: "3.10-pymongo3", python: "3.10", tox: py310-pymongo3 }
- { name: "3.13-pymongo4", python: "3.13", tox: py313-pymongo4 }
- { name: "3.10-motor", python: "3.10", tox: py310-motor }
- { name: "3.13-motor", python: "3.13", tox: py313-motor }
- { name: "3.10-txmongo", python: "3.10", tox: py310-txmongo }
- { name: "3.13-txmongo", python: "3.13", tox: py313-txmongo }
steps:
- uses: actions/checkout@v6
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.12.1
with:
mongodb-version: 8.0
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- run: python -m pip install tox
- run: python -m tox -e ${{ matrix.tox }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install pypa/build
run: python -m pip install build
- name: Build a binary wheel and a source tarball
run: python -m build
- name: Install twine
run: python -m pip install twine
- name: Check build
run: python -m twine check --strict dist/*
- name: Store the distribution packages
uses: actions/upload-artifact@v7
with:
name: python-package-distributions
path: dist/
# this duplicates pre-commit.ci, so only run it on tags
# it guarantees that linting is passing prior to a release
lint-pre-release:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.13"
- run: python -m pip install tox
- run: python -m tox -e lint
publish-to-pypi:
name: PyPI release
if: startsWith(github.ref, 'refs/tags/')
needs: [lint-pre-release, build, tests]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/umongo
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v8
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1