Creating template type using event driven #680
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: Python application. | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
env: | |
SECRET_KEY: "SK" | |
DEBUG: true | |
DATABASE_URL: "postgres://chats:chats@localhost:5432/chats" | |
USE_WENI_FLOWS: false | |
PROMETHEUS_AUTH_TOKEN: "aaaa" | |
UNPERMITTED_AUDIO_TYPES: "WebM,audio/mpeg3,audio/mpeg,mp3" | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
services: | |
postgres: | |
image: postgres:12 | |
env: | |
POSTGRES_USER: chats | |
POSTGRES_PASSWORD: chats | |
POSTGRES_DB: chats | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
redis: | |
image: redis:6.2 | |
ports: | |
- 6379:6379 | |
# Set health checks to wait until redis has started | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip poetry | |
poetry config virtualenvs.create false --local | |
poetry install | |
- name: Run migrations | |
run: python manage.py migrate | |
- name: run flake8 | |
run: flake8 | |
- name: run black | |
run: black . | |
- name: run isort | |
run: isort . | |
- name: Run tests | |
run: coverage run manage.py test --verbosity=2 --noinput | |
- name: Coverage report | |
run: coverage report -m |