-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (51 loc) · 1.55 KB
/
ci.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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
ports:
- 5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 'postgres'
POSTGRES_DB: editgroups
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install -r requirements.txt
pip install psycopg2-binary==2.9.7 coveralls
pip freeze
echo "from .dev import *" > editgroups/settings/__init__.py
cat editgroups/settings/secret_gh_action.py | sed -e "s/POSTGRES_PORT/${{ job.services.postgres.ports[5432] }}/g" | sed -e "s/REDIS_REAL_PORT/${{ job.services.redis.ports[6379] }}/g" > editgroups/settings/secret.py
- name: Run Django tests
run: |
coverage run --source=editgroups,store,revert,tagging --omit=*/migrations/*,edtigroups/settings/* manage.py test -v 2
env:
DJANGO_SETTINGS_MODULE: editgroups.settings