[odrs-web/barthalion/add-tests-to-ci] Add unit tests to CI




commit 305410d2d21704f418c155f409b02f3b2fea023a
Author: Bartłomiej Piotrowski <b bpiotrowski pl>
Date:   Wed Aug 31 22:20:58 2022 +0200

    Add unit tests to CI
    
    Additionally, introduce a separate job for testing the Docker build.

 .gitlab-ci.yml | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8e0c08..15cb33c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,14 +2,34 @@ include:
   - project: 'Infrastructure/openshift-images/ci-templates'
     file: '/kaniko.yml'
 
-odrs-dev:
+build-image:
+  stage: test
+  extends:
+    - .kaniko-root
+  variables:
+    CI_COMMIT_REF_PROTECTED: false
+
+tests:
+  stage: test
+  image: registry.access.redhat.com/ubi8/python-39
+  script:
+    - pip install -r requirements.txt
+    - ODRS_REVIEWS_SECRET=not-secret4 python odrs/tests/util_test.py
+    - python odrs/tests/odrs_test.py
+
+deploy-dev:
+  stage: deploy
   extends:
     - .kaniko-root
   variables:
     CI_CUSTOM_IMAGE_NAME: "odrs"
     OCI_TAG: "dev"
+  rules:
+  - if: $CI_COMMIT_REF_NAME == "master"
+    when: manual
 
-odrs:
+deploy-prod:
+  stage: deploy
   extends:
     - .kaniko-root
   variables:
@@ -17,7 +37,8 @@ odrs:
     OCI_TAG: "latest"
   when: manual
 
-nginx:
+deploy-prod-nginx:
+  stage: deploy
   extends:
     - .kaniko-root
   variables:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]