[pre-commit.ci] pre-commit autoupdate (#114) #285
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
uses: knyghty/actions/.github/workflows/lint-python.yml@main | |
with: | |
black: false | |
flake8: false | |
isort: false | |
mypy: true | |
package-manager: pip | |
python-version: "3.12" | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- uses: actions/checkout@v4 | |
- run: | | |
python -m pip install -U pip wheel | |
python -m pip install -e . | |
python -m pip install sphinx sphinx-rtd-theme sphinxcontrib-spelling | |
- run: | | |
cd docs | |
sphinx-build -b spelling -n -d _build/doctrees . _build/spelling | |
SQLite: | |
needs: [docs, lint] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
django-version: ["4.2", "5.0", "5.1"] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
exclude: | |
- django-version: "5.0" | |
python-version: "3.8" | |
- django-version: "5.0" | |
python-version: "3.9" | |
- django-version: "5.1" | |
python-version: "3.8" | |
- django-version: "5.1" | |
python-version: "3.9" | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: sudo apt-get update && sudo apt-get install libmemcached-dev | |
- uses: actions/checkout@v4 | |
- run: | | |
python -m pip install -U pip wheel | |
pip install -e . | |
python -m pip install jinja2 pillow | |
python -m pip install django~=${{ matrix.django-version }} | |
- run: python runtests.py | |
PostgreSQL: | |
needs: [docs, lint] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
django-version: ["4.2", "5.0", "5.1"] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
exclude: | |
- django-version: "5.0" | |
python-version: "3.8" | |
- django-version: "5.0" | |
python-version: "3.9" | |
- django-version: "5.1" | |
python-version: "3.8" | |
- django-version: "5.1" | |
python-version: "3.9" | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: snakeoil | |
POSTGRES_PASSWORD: snakeoil | |
ports: | |
- 5432/tcp | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v4 | |
- run: | | |
python -m pip install -U pip wheel | |
python -m pip install -e . | |
python -m pip install jinja2 pillow psycopg2 | |
python -m pip install django~=${{ matrix.django-version }} | |
- run: python runtests.py | |
env: | |
DB: postgres | |
DB_PORT: ${{ job.services.postgres.ports[5432] }} | |
MySQL: | |
needs: [docs, lint] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
django-version: ["4.2", "5.0", "5.1"] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
exclude: | |
- django-version: "5.0" | |
python-version: "3.8" | |
- django-version: "5.0" | |
python-version: "3.9" | |
- django-version: "5.1" | |
python-version: "3.8" | |
- django-version: "5.1" | |
python-version: "3.9" | |
services: | |
mysql: | |
image: mysql | |
ports: | |
- 3306 | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
env: | |
MYSQL_ROOT_PASSWORD: snakeoil | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: sudo apt-get update && sudo apt-get install libmysqlclient-dev | |
- uses: actions/checkout@v4 | |
- run: | | |
python -m pip install -U pip wheel | |
python -m pip install -e . | |
python -m pip install jinja2 pillow mysqlclient | |
python -m pip install django~=${{ matrix.django-version }} | |
- run: python runtests.py | |
env: | |
DB: mysql | |
DB_PORT: ${{ job.services.mysql.ports['3306'] }} | |
MariaDB: | |
needs: [docs, lint] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
django-version: ["4.2", "5.0", "5.1"] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
exclude: | |
- django-version: "5.0" | |
python-version: "3.8" | |
- django-version: "5.0" | |
python-version: "3.9" | |
- django-version: "5.1" | |
python-version: "3.8" | |
- django-version: "5.1" | |
python-version: "3.9" | |
services: | |
mariadb: | |
image: mariadb | |
ports: | |
- 3306 | |
options: >- | |
--health-cmd="mariadb-admin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
env: | |
MYSQL_ROOT_PASSWORD: snakeoil | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: sudo apt-get update && sudo apt-get install libmariadb-dev | |
- uses: actions/checkout@v4 | |
- run: | | |
python -m pip install -U pip wheel | |
pip install -e . | |
python -m pip install jinja2 pillow mysqlclient | |
python -m pip install django~=${{ matrix.django-version }} | |
- run: python runtests.py | |
env: | |
DB: mariadb | |
DB_PORT: ${{ job.services.mariadb.ports['3306'] }} | |
release: | |
if: ${{ github.event_name == 'release' }} | |
runs-on: ubuntu-latest | |
needs: [docs, lint, SQLite, PostgreSQL, MySQL, MariaDB] | |
environment: | |
name: pypi | |
url: https://pypi.org/p/django-rq-email-backend | |
permissions: | |
id-token: write | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: python -m pip install -U pip wheel build | |
- name: Build package | |
run: python -m build | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 |