diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4eba9de627..495c8bc4fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..48082f72f0 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +12