mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-23 01:57:03 +03:00
42c30dafcb
* Upgrade Python to version 3.11 (Faster CPython) * Update pyupgrade config for Python 3.11 * Update tox env to Python 3.11 * Update to latest Python 3.11.3 * Add a note about lack of support in PythonAnywhere * Rephrase note * Fix casing --------- Co-authored-by: Bruno Alla <alla.brunoo@gmail.com> Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
55 lines
1.3 KiB
YAML
55 lines
1.3 KiB
YAML
stages:
|
|
- lint
|
|
- test
|
|
|
|
variables:
|
|
POSTGRES_USER: '{{ cookiecutter.project_slug }}'
|
|
POSTGRES_PASSWORD: ''
|
|
POSTGRES_DB: 'test_{{ cookiecutter.project_slug }}'
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
{%- if cookiecutter.use_celery == 'y' %}
|
|
CELERY_BROKER_URL: 'redis://redis:6379/0'
|
|
{%- endif %}
|
|
|
|
precommit:
|
|
stage: lint
|
|
image: python:3.11
|
|
variables:
|
|
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
|
|
cache:
|
|
paths:
|
|
- ${PRE_COMMIT_HOME}
|
|
before_script:
|
|
- pip install -q pre-commit
|
|
script:
|
|
- pre-commit run --show-diff-on-failure --color=always --all-files
|
|
|
|
pytest:
|
|
stage: test
|
|
{%- if cookiecutter.use_docker == 'y' %}
|
|
image: docker/compose:1.29.2
|
|
tags:
|
|
- docker
|
|
services:
|
|
- docker:dind
|
|
before_script:
|
|
- docker-compose -f local.yml build
|
|
# Ensure celerybeat does not crash due to non-existent tables
|
|
- docker-compose -f local.yml run --rm django python manage.py migrate
|
|
- docker-compose -f local.yml up -d
|
|
script:
|
|
- docker-compose -f local.yml run django pytest
|
|
{%- else %}
|
|
image: python:3.11
|
|
tags:
|
|
- python
|
|
services:
|
|
- postgres:{{ cookiecutter.postgresql_version }}
|
|
variables:
|
|
DATABASE_URL: pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres/$POSTGRES_DB
|
|
before_script:
|
|
- pip install -r requirements/local.txt
|
|
script:
|
|
- pytest
|
|
{%- endif %}
|