-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (93 loc) · 3.04 KB
/
tests.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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.10'
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