Collect static before
Run as a separate job, and then tests split out into 2
This commit is contained in:
parent
c16b81a618
commit
2c1cc3e411
2 changed files with 30 additions and 4 deletions
|
@ -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
|
||||
|
|
2
justfile
2
justfile
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue