Switch to ruff (#47) #140
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.11" | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- uses: actions/checkout@v3 | |
- run: | | |
python setup.py develop | |
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: ["3.2", "4.1", "4.2"] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: sudo apt-get update && sudo apt-get install libmemcached-dev | |
- uses: actions/checkout@v3 | |
- run: | | |
python setup.py develop | |
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: ["3.2", "4.1", "4.2"] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
services: | |
postgres: | |
image: postgres:12 | |
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@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v3 | |
- run: | | |
python setup.py develop | |
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: ["3.2", "4.1", "4.2"] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
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@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: sudo apt-get update && sudo apt-get install libmysqlclient-dev | |
- uses: actions/checkout@v3 | |
- run: | | |
python setup.py develop | |
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: ["3.2", "4.1", "4.2"] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
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@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: sudo apt-get update && sudo apt-get install libmariadb-dev | |
- uses: actions/checkout@v3 | |
- run: | | |
python setup.py develop | |
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: | |
needs: [docs, lint, SQLite, PostgreSQL, MySQL, MariaDB] | |
if: ${{ github.event_name == 'release' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-python@v4 | |
- uses: actions/checkout@v3 | |
- name: build | |
run: | | |
python -m pip install setuptools twine wheel | |
python setup.py sdist bdist_wheel | |
- name: publish | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
TWINE_NON_INTERACTIVE: 1 | |
run: twine upload dist/* |