Skip to content

Commit

Permalink
[#1570] use custom GH action to set up backend environment
Browse files Browse the repository at this point in the history
  • Loading branch information
pi-sigma committed Aug 10, 2023
1 parent ae075c2 commit b0f6c9a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
35 changes: 12 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 @@ -40,34 +42,22 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- 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
optimize-postgres: 'yes'
pg-service: 'postgres'
setup-node: 'yes'
npm-ci-flags: '--legacy-peer-deps'

- name: Install dependencies
- name: Install additional dependencies (playwright)
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
- name: Run tests
run: |
python src/manage.py collectstatic --noinput --link
Expand All @@ -76,8 +66,7 @@ jobs:
src/manage.py test src \
--parallel \
--exclude-tag=elastic
coverage run src/manage.py test src --tag no-parallel
coverage combine
coverage run src/manage.py test src --tag=elastic
env:
DJANGO_SETTINGS_MODULE: open_inwoner.conf.ci
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12

0 comments on commit b0f6c9a

Please sign in to comment.