diff --git a/.env.testing b/.env.testing index d8d2568a..deeebc6c 100644 --- a/.env.testing +++ b/.env.testing @@ -1,6 +1,6 @@ SECRET_KEY='django-insecure-w!h85bp^$$e8gm%c23r!0%9i7yzd=6w$$s&ic+6!%306&kj8@k*5' DEBUG=True -DB_HOST=db +DB_HOST=localhost DB_PORT=5432 DB_NAME=term_db DB_USER=sadilar diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index defaa2d2..f0b7be32 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -3,6 +3,16 @@ on: [ pull_request, push ] # activates the workflow when there is a push or pull jobs: test_project: runs-on: ubuntu-latest # operating system your code will run on + services: + postgres: + image: postgres:13 + env: + POSTGRES_USER: sadilar + POSTGRES_PASSWORD: sadilar + POSTGRES_DB: test_db_1 + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -20,6 +30,7 @@ jobs: sudo chown runner:runner /logging - name: Run validate_templates run: | + export DJANGO_TEST_PROCESSES=1 cp .env.testing app/.env cd app/ mkdir -p static_files @@ -30,6 +41,9 @@ jobs: cd app/ mkdir -p static_files python manage.py test + env: + DJANGO_SETTINGS_MODULE: app.settings + DATABASE_URL: postgres://sadilar:sadilar@localhost:5432/test_db - name: Manager Check run: | cd app/