[#227] Script for running the testing app with prod data #638
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Climate plan monitor CI | |
on: | |
push: | |
workflow_dispatch: | |
env: | |
PYTHON_VERSION: '3.10' | |
POETRY_VERSION: '1.3.2' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: install pytest and playwright | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry==${{ env.POETRY_VERSION }} | |
poetry install --with dev | |
poetry run playwright install --with-deps chromium | |
- name: install javascript dependencies | |
run: | | |
yarn install | |
- name: Run pre-commit hooks on all files | |
run: SKIP=no-commit-to-branch poetry run pre-commit run --all-files | |
- name: create database | |
run: poetry run python manage.py migrate --settings=config.settings.local | |
- name: fill database | |
run: poetry run python manage.py loaddata --settings=config.settings.local e2e_tests/database/test_database.json | |
- name: create networks | |
run: | | |
docker network create testing_nginx_network | |
docker network create production_nginx_network | |
- name: start reverse-proxy | |
run: docker compose -f docker/reverseproxy/docker-compose.yml up -d --build | |
- name: build testing application | |
run: docker-compose -f docker-compose.yml up -d | |
- name: run tests | |
run: poetry run pytest |