-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (59 loc) · 1.47 KB
/
testing.yml
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
name: Django CI
on:
push:
branches: [ database_test ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: github_actions
ports:
- 5432:5432
#Set health checks to wait until postgres has started
options:
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:latest
ports:
- 6379/tcp
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: psycopg2 prerequisites
run: sudo apt-get install libpq-dev
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# - name: Lint with flake8
# run: |
# pip install flake8
# flake8
- name: Run celery worker for tests
run: |
celery -A BPPRC worker -B -Q celery -l DEBUG --detach
- name: Coverage report
run: |
pip install coverage
coverage run manage.py test
coverage report
- name: Run migrations
run: python manage.py migrate
- name: Run Tests
run: |
python manage.py test