-
-
Notifications
You must be signed in to change notification settings - Fork 184
67 lines (64 loc) · 2.54 KB
/
pytest.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
64
65
66
67
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: pytest
on:
push:
branches: [ master, beta ]
pull_request:
jobs:
build:
runs-on: ubuntu-20.04
env:
DATABASE_URL: postgis://kobo:kobo@localhost:5432/kpi_test
DJANGO_LANGUAGE_CODES: "ar cs de-DE en es fr hi ku pl pt tr zh-hans"
DJANGO_SECRET_KEY: notSecretJustForTestingYep
DJANGO_SETTINGS_MODULE: kobo.settings.testing
REDIS_SESSION_URL: redis://localhost:6379
SERVICE_ACCOUNT_BACKEND_URL: redis://localhost:6379/4
CACHE_URL: redis://localhost:6379/3
ENKETO_REDIS_MAIN_URL: redis://localhost:6379/0
KOBOCAT_MEDIA_ROOT: /tmp/test_media
strategy:
matrix:
python-version: ['3.8', '3.10']
services:
postgres:
image: postgis/postgis:14-3.4
env:
POSTGRES_USER: kobo
POSTGRES_PASSWORD: kobo
POSTGRES_DB: kpi_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis_cache:
image: redis:6.2
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pip-tools
run: python -m pip install pip-tools==7.\*
- name: Update Debian package lists
run: sudo DEBIAN_FRONTEND=noninteractive apt-get -y update
- name: Install Debian dependencies
# All about YAML line breaks: https://stackoverflow.com/a/21699210
run: >-
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install
gdal-bin gettext libproj-dev postgresql-client ffmpeg
gcc libc-dev build-essential
- name: Install Python dependencies
run: pip-sync dependencies/pip/dev_requirements.txt
- name: Update translations
run: git submodule init && git submodule update --remote && python manage.py compilemessages
- name: Test back-end code
# Explicitly name the directories where coverage should be measured;
# specifying just `--cov=.` includes `src`, which contains third-party packages
run: pytest --cov=hub --cov=kobo --cov=kpi -ra
- name: Run coveralls for back-end code
uses: AndreMiras/coveralls-python-action@develop
# Coveralls action will intermittently give 422 errors - until that issue is resolved this step allowed to error.
continue-on-error: true