2021-01-08 06:34:39 +03:00
|
|
|
dist: focal
|
2020-04-14 18:52:14 +03:00
|
|
|
|
2015-08-04 18:39:27 +03:00
|
|
|
language: python
|
|
|
|
python:
|
2024-03-18 21:55:00 +03:00
|
|
|
- "3.12"
|
2020-04-14 18:52:14 +03:00
|
|
|
|
|
|
|
services:
|
|
|
|
- {% if cookiecutter.use_docker == 'y' %}docker{% else %}postgresql{% endif %}
|
|
|
|
jobs:
|
|
|
|
include:
|
|
|
|
- name: "Linter"
|
|
|
|
before_script:
|
2024-02-06 21:56:31 +03:00
|
|
|
- pip install -q ruff
|
2020-04-14 18:52:14 +03:00
|
|
|
script:
|
2024-02-06 21:56:31 +03:00
|
|
|
- ruff check .
|
2020-04-14 18:52:14 +03:00
|
|
|
|
|
|
|
- name: "Django Test"
|
2020-04-16 21:15:35 +03:00
|
|
|
{%- if cookiecutter.use_docker == 'y' %}
|
2020-04-14 18:52:14 +03:00
|
|
|
before_script:
|
2023-07-24 12:42:51 +03:00
|
|
|
- docker compose -v
|
2020-04-14 18:52:14 +03:00
|
|
|
- docker -v
|
2024-05-13 20:18:56 +03:00
|
|
|
- docker compose -f docker-compose.local.yml build
|
|
|
|
- docker compose -f docker-compose.docs.yml build
|
2020-04-16 20:34:12 +03:00
|
|
|
# Ensure celerybeat does not crash due to non-existent tables
|
2024-05-13 20:18:56 +03:00
|
|
|
- docker compose -f docker-compose.local.yml run --rm django python manage.py migrate
|
|
|
|
- docker compose -f docker-compose.local.yml up -d
|
2020-04-14 18:52:14 +03:00
|
|
|
script:
|
2024-05-13 20:18:56 +03:00
|
|
|
- docker compose -f docker-compose.local.yml run django pytest
|
2020-04-14 18:52:14 +03:00
|
|
|
after_failure:
|
2024-05-13 20:18:56 +03:00
|
|
|
- docker compose -f docker-compose.local.yml logs
|
2020-04-14 18:52:14 +03:00
|
|
|
{%- else %}
|
|
|
|
before_install:
|
|
|
|
- sudo apt-get update -qq
|
|
|
|
- sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb
|
|
|
|
- sudo apt-get install -qq libjpeg8-dev libfreetype6-dev libwebp-dev
|
|
|
|
- sudo apt-get install -qq graphviz-dev python-setuptools python3-dev python-virtualenv python-pip
|
|
|
|
- sudo apt-get install -qq firefox automake libtool libreadline6 libreadline6-dev libreadline-dev
|
|
|
|
- sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm
|
|
|
|
language: python
|
|
|
|
python:
|
2024-03-18 21:55:00 +03:00
|
|
|
- "3.12"
|
2020-04-14 18:52:14 +03:00
|
|
|
install:
|
|
|
|
- pip install -r requirements/local.txt
|
|
|
|
script:
|
2024-02-06 21:56:31 +03:00
|
|
|
- pytest
|
2020-04-14 18:52:14 +03:00
|
|
|
{%- endif %}
|