-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (66 loc) · 1.81 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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"
USE_EDA: true
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