From 1e2d0b3825550d73ee8b4c21192be2db3bdb1e5c Mon Sep 17 00:00:00 2001 From: Ahmed Date: Fri, 27 Oct 2023 17:36:12 +1100 Subject: [PATCH] Changes made to the files --- .github/workflows/ci.yml | 6 +++++- tests/test_docker.sh | 2 +- tests/test_production_build.py | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98a3a509b..fd67afd3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,6 +114,7 @@ jobs: - name: Bare Metal ${{ matrix.script.name }} run: sh tests/test_bare.sh ${{ matrix.script.args }} + production-check: runs-on: ubuntu-latest steps: @@ -122,7 +123,10 @@ jobs: with: python-version: "3.11" cache: pip + - name: Generate project + run: cookiecutter . --no-input project_slug=test_project - name: Install production dependencies - run: pip install -r {{cookiecutter.project_slug}}/requirements/production.txt + run: pip install -r test_project/requirements/production.txt - name: Run Django deployment checks + working-directory: test_project run: python manage.py check --deploy \ No newline at end of file diff --git a/tests/test_docker.sh b/tests/test_docker.sh index c4129bcbe..26bbdf4a5 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -32,7 +32,7 @@ docker compose -f local.yml run django python manage.py makemessages --all # Make sure the check doesn't raise any warnings docker compose -f local.yml run django python manage.py check --fail-level WARNING -# Check for deployment-specific issues +# Check for deployment specific issues docker compose -f local.yml run django python manage.py check --deploy # Generate the HTML for the documentation diff --git a/tests/test_production_build.py b/tests/test_production_build.py index 5abe98a57..82ddeba20 100644 --- a/tests/test_production_build.py +++ b/tests/test_production_build.py @@ -1,5 +1,7 @@ +import os import subprocess def test_production_check(): - # This will raise an exception if there's an error - subprocess.check_call(['python', 'manage.py', 'check', '--deploy']) \ No newline at end of file + base_dir = os.getcwd() + manage_py_path = os.path.join(base_dir, "test_project", "manage.py") + subprocess.check_call(['python', manage_py_path, 'check', '--deploy']) \ No newline at end of file