Improved test coverage of production build/config

This commit is contained in:
Ahmed 2023-10-27 17:26:40 +11:00
parent 52eaf46f49
commit 8bf4fba7b4
3 changed files with 21 additions and 0 deletions

View File

@ -113,3 +113,16 @@ jobs:
node-version: "18"
- name: Bare Metal ${{ matrix.script.name }}
run: sh tests/test_bare.sh ${{ matrix.script.args }}
production-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
- name: Install production dependencies
run: pip install -r {{cookiecutter.project_slug}}/requirements/production.txt
- name: Run Django deployment checks
run: python manage.py check --deploy

View File

@ -32,6 +32,9 @@ 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
docker compose -f local.yml run django python manage.py check --deploy
# Generate the HTML for the documentation
docker compose -f local.yml run docs make html

View File

@ -0,0 +1,5 @@
import subprocess
def test_production_check():
# This will raise an exception if there's an error
subprocess.check_call(['python', 'manage.py', 'check', '--deploy'])