Skip to content

[pre-commit.ci] pre-commit autoupdate (#122) #307

[pre-commit.ci] pre-commit autoupdate (#122)

[pre-commit.ci] pre-commit autoupdate (#122) #307

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- 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]
runs-on: ubuntu-latest
strategy:
matrix:
django-version: ["4.2", "5.0", "5.1"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
- django-version: "5.0"
python-version: "3.9"
- 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]
runs-on: ubuntu-latest
strategy:
matrix:
django-version: ["4.2", "5.0", "5.1"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
- django-version: "5.0"
python-version: "3.9"
- 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 psycopg
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]
runs-on: ubuntu-latest
strategy:
matrix:
django-version: ["4.2", "5.0", "5.1"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
- django-version: "5.0"
python-version: "3.9"
- 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]
runs-on: ubuntu-latest
strategy:
matrix:
django-version: ["4.2", "5.0", "5.1"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
- django-version: "5.0"
python-version: "3.9"
- 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, SQLite, PostgreSQL, MySQL, MariaDB]
environment:
name: pypi
url: https://pypi.org/p/django-snakeoil
permissions:
id-token: write
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- 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