diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 354dee2..4af2e8a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/justfile b/justfile index 8a58e72..d7bd0bd 100644 --- a/justfile +++ b/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 }}