From 143e1bc57054626c8621689a38c3f8656d84fa6e Mon Sep 17 00:00:00 2001 From: Viswamedha Nalabotu Date: Sat, 20 Dec 2025 21:00:05 +0000 Subject: [PATCH] Added test stage --- .gitlab-ci.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 53f62c5..ca0b1fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,18 @@ stages: + - test - build +run_tests: + stage: test + image: python:3.12 + before_script: + - python -m pip install --upgrade pip + - pip install --no-cache-dir -r requirements/base.txt + script: + - python manage.py test --verbosity=2 + rules: + - if: $CI_COMMIT_BRANCH == "main" + build_and_push: stage: build image: docker:24.0.7 @@ -9,8 +21,8 @@ build_and_push: DOCKER_TLS_CERTDIR: '' services: - name: docker:24.0.7-dind - alias: docker - command: ['--tls=false', '--host=tcp://0.0.0.0:2375'] + alias: docker + command: ['--tls=false', '--host=tcp://0.0.0.0:2375'] script: - echo "Waiting for Docker daemon..." - for i in $(seq 1 30); do docker info && break || sleep 1; done