Skip to content

App Datenmanagement: Bereinigungsarbeiten Code #180

App Datenmanagement: Bereinigungsarbeiten Code

App Datenmanagement: Bereinigungsarbeiten Code #180

Workflow file for this run

name: Tests
on:
push:
branches:
- master
workflow_dispatch:
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB_DEFAULT: datenwerft
POSTGRES_DB_DATENMANAGEMENT: datenmanagement
jobs:
tests:
name: Tests on all apps
runs-on: ubuntu-latest
services:
openldap:
image: bitnami/openldap:latest
env:
LDAP_ROOT: dc=example,dc=org
LDAP_ADMIN_USERNAME: admin
LDAP_ADMIN_PASSWORD: password
LDAP_USERS: user01,user02
LDAP_PASSWORDS: password1,password2
ports:
- 1389:1389
postgres:
image: postgis/postgis
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.POSTGRES_DB_DATENMANAGEMENT }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: latest
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install prerequisites for Python dependencies
run: |
sudo apt-get --fix-missing update
sudo apt-get install gdal-bin libgdal-dev libldap2-dev libpq-dev libsasl2-dev postgresql-client
- name: Prevent locale issues
run: |
sudo locale-gen de_DE.UTF-8
sudo dpkg-reconfigure locales
export LC_ALL="de_DE.UTF-8"
export LC_CTYPE="de_DE.UTF-8"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create further settings file based on corresponding template
run: cp datenwerft/secrets.template datenwerft/secrets.py
- name: Create default database and database schema for app Datenmanagement
env:
PGPASSWORD: ${{ env.POSTGRES_PASSWORD }}
run: |
createdb -h localhost -U $POSTGRES_USER $POSTGRES_DB_DEFAULT
psql -h localhost -U $POSTGRES_USER -d $POSTGRES_DB_DATENMANAGEMENT -f datenmanagement/sql/schema.sql
- name: Install Node.js dependencies
run: npm install
- name: Create HTML files for help
run: |
cd hilfe
mkdir source/_static
make html
cd ..
- name: Collect static files
run: python manage.py collectstatic -c
- name: Run migrations
run: python manage.py migrate
- name: Run tests on app Accounts
run: python manage.py test accounts
- name: Run tests on app Toolbox
run: python manage.py test toolbox
- name: Run tests on app Datenmanagement
run: python manage.py test datenmanagement
- name: Run tests on app BEMAS
run: python manage.py test bemas