Skip to content

Commit

Permalink
Merge pull request #805 from maykinmedia/develop
Browse files Browse the repository at this point in the history
Release v1.11
  • Loading branch information
alextreme authored Oct 10, 2023
2 parents 2a9e24b + 64b1b4d commit 5b6f10b
Show file tree
Hide file tree
Showing 221 changed files with 30,744 additions and 3,012 deletions.
128 changes: 99 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ env:
IMAGE_NAME: maykinmedia/open-inwoner

jobs:
#
# Unit and integration tests
#
tests:
name: Run the Django test suite
runs-on: ubuntu-latest
Expand All @@ -26,7 +29,9 @@ jobs:
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
options:
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
--name postgres

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.2
Expand All @@ -38,50 +43,115 @@ jobs:
- 9300:9300

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up backend environment
uses: maykinmedia/setup-django-backend@v1
with:
apt-packages: 'libxml2-dev libxmlsec1-dev libxmlsec1-openssl gettext postgresql-client libgdal-dev gdal-bin'
python-version: '3.9'
- uses: actions/setup-node@v2-beta
with:
node-version: '12'

- name: Install system packages
run: |
sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends \
libgdal-dev \
gdal-bin
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libxml2-dev libxmlsec1-dev libxmlsec1-openssl
pip install -r requirements/dev.txt
playwright install
playwright install msedge
playwright install-deps
- name: Build frontend
run: |
npm ci
npm run build
optimize-postgres: 'yes'
pg-service: 'postgres'
setup-node: 'yes'
npm-ci-flags: '--legacy-peer-deps'

- name: Run tests
run: |
python src/manage.py collectstatic --noinput --link
coverage run src/manage.py test src
coverage run \
--concurrency=multiprocessing \
--parallel-mode \
src/manage.py test src \
--parallel \
--exclude-tag=e2e \
--exclude-tag=elastic
coverage run src/manage.py test src --tag=elastic --exclude-tag=e2e
coverage combine
env:
DJANGO_SETTINGS_MODULE: open_inwoner.conf.ci
SECRET_KEY: dummy
DB_USER: postgres
DB_PASSWORD: ''

- name: Publish coverage report
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}

#
# End-to-end tests
#
e2etests:
runs-on: ubuntu-latest
strategy:
matrix:
browser:
- chromium
- firefox
- webkit
- msedge

name: End-to-end tests, ${{ matrix.browser }}

services:
postgres:
image: postgis/postgis:10-2.5
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
# Needed because the postgres container does not provide a healthcheck
options:
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
--name postgres

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.2
env:
discovery.type: single-node
ES_JAVA_OPTS: '-Xms512m -Xmx512m'
ports:
- 9200:9200
- 9300:9300

steps:
- uses: actions/checkout@v3
- name: Set up backend environment
uses: maykinmedia/setup-django-backend@v1
with:
apt-packages: 'libxml2-dev libxmlsec1-dev libxmlsec1-openssl gettext postgresql-client libgdal-dev gdal-bin'
python-version: '3.9'
optimize-postgres: 'yes'
pg-service: 'postgres'
setup-node: 'yes'
npm-ci-flags: '--legacy-peer-deps'

# See https://playwright.dev/python/docs/ci#caching-browsers
- name: Cache Playwright browser
id: cache-browser
uses: actions/cache@v3
with:
path: /home/runner/.cache/ms-playwright
key:
${{ runner.os }}-${{ matrix.browser }}-playwright-${{ hashFiles('requirements/ci.txt') }}

- name: Install playwright deps
run: playwright install --with-deps ${{ matrix.browser }}

- name: Run testsuite
run: |
python src/manage.py collectstatic --noinput --link
src/manage.py test src --tag=e2e
env:
DJANGO_SETTINGS_MODULE: open_inwoner.conf.ci
SECRET_KEY: dummy
DB_USER: postgres
DB_PASSWORD: ''
E2E_DRIVER: ${{ matrix.browser }}

#
# Docker
#
docker:
needs: tests

Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12
22 changes: 22 additions & 0 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@ using ``npm run watch``.
.. _Sass: https://sass-lang.com/


ElasticSearch
-------------

1. To start ElasticSearch, run the following command:

.. code-block:: bash
$ bin/start_elasticsearch.sh
2. Then build the indices:

.. code-block:: bash
$ src/manage.py search_index --rebuild
Update installation
-------------------

Expand Down Expand Up @@ -155,6 +171,12 @@ When updating an existing installation:
$ python src/manage.py collectstatic --link
$ python src/manage.py migrate
4. Update the ElasticSearch indices:

.. code-block:: bash
$ src/manage.py search_index --rebuild
Testsuite
---------
Expand Down
7 changes: 7 additions & 0 deletions bin/generate_xsdata_classes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

rm -rf ./src/open_inwoner/ssd/service
cd ./src

xsdata --package open_inwoner.ssd.service.jaaropgave "open_inwoner/ssd/files/jaaropgave/v0400-b01/JaarOpgaveClient.wsdl"
xsdata --package open_inwoner.ssd.service.uitkering "open_inwoner/ssd/files/uitkering/v0600-b01/UitkeringsSpecificatieClient.wsdl"
Loading

0 comments on commit 5b6f10b

Please sign in to comment.