Record all logins as access logs #5486
Workflow file for this run
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
# 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@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
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 |