Collect static before

Run as a separate job, and then tests split out into 2
This commit is contained in:
Jake Howard 2022-06-10 17:14:30 +01:00
parent c16b81a618
commit 2c1cc3e411
Signed by: jake
GPG Key ID: 57AFB45680EDD477
2 changed files with 30 additions and 4 deletions

View File

@ -1,3 +1,5 @@
image: python:3.10-slim
stages:
- build
- test
@ -38,15 +40,39 @@ pip:
- ./env/
expire_in: 30 mins
test_python:
image: python:3.10-slim
.python_test_template: &python_test_template
stage: test
dependencies:
- pip
- static
- collect_static
before_script:
- source env/bin/activate
variables:
SECRET_KEY: super-secret
collect_static:
<<: *python_test_template
stage: build
dependencies:
- pip
- static
script:
- ./manage.py collectstatic --noinput -v2 --clear
artifacts:
name: 'static-$CI_JOB_ID'
paths:
- ./collected-static/
expire_in: 30 mins
test_python:
<<: *python_test_template
script:
- ./manage.py check
- ./manage.py makemigrations --check --noinput
- ./manage.py test
django_checks:
<<: *python_test_template
script:
- ./manage.py check
- ./manage.py makemigrations --check --noinput

View File

@ -22,7 +22,7 @@ install:
./manage.py {{ ARGS }}
@collectstatic:
./manage.py collectstatic --noinput -v2
./manage.py collectstatic --noinput -v2 --clear
test *ARGS:
./manage.py test {{ ARGS }}