added mysql support in github actions

This commit is contained in:
Abdullah Adeel 2022-01-10 03:02:32 +05:00
parent 25018d5116
commit ddcef98212

View File

@ -47,20 +47,36 @@ jobs:
ports: ports:
- 6379:6379 - 6379:6379
{%- endif %} {%- endif %}
{%- if cookiecutter.database_engine == 'postgresql' %}
postgres: postgres:
image: postgres:12 image: postgres:12
ports: ports:
- 5432:5432 - 5432:5432
env: env:
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: postgres
{%- endif %}
{%- if cookiecutter.database_engine == 'mysql' %}
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_PASSWORD: mysql
{%- endif %}
env: env:
{%- if cookiecutter.use_celery == 'y' %} {%- if cookiecutter.use_celery == 'y' %}
CELERY_BROKER_URL: "redis://localhost:6379/0" CELERY_BROKER_URL: "redis://localhost:6379/0"
{%- endif %} {%- endif %}
{%- if cookiecutter.database_engine == 'postgresql' %}
# postgres://user:password@host:port/database # postgres://user:password@host:port/database
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres" DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres"
{%- endif %} {%- endif %}
{%- if cookiecutter.database_engine == 'mysql' %}
# mysql://user:password@host:port/database
DATABASE_URL: "mysql://mysql:mysql@localhost:3306/mysql"
{%- endif %}
{%- endif %}
steps: steps: