[odrs-web/barthalion/add-tests-to-ci] Add unit tests to CI
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [odrs-web/barthalion/add-tests-to-ci] Add unit tests to CI
- Date: Wed, 31 Aug 2022 20:35:04 +0000 (UTC)
commit 331f90f464284d3db905367767e10982933ddbaa
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 | 40 +++++++++++++++++++++++++++++++++++-----
1 file changed, 35 insertions(+), 5 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8e0c08..28ecbdf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,26 +2,56 @@ include:
- project: 'Infrastructure/openshift-images/ci-templates'
file: '/kaniko.yml'
-odrs-dev:
+stages:
+ - build
+ - test
+ - deploy
+
+build-image:
+ stage: build
+ 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: always
-odrs:
+deploy-prod:
+ stage: deploy
extends:
- .kaniko-root
variables:
CI_CUSTOM_IMAGE_NAME: "odrs"
OCI_TAG: "latest"
- when: manual
+ rules:
+ - if: $CI_COMMIT_REF_NAME == "master"
+ when: manual
-nginx:
+deploy-prod-nginx:
+ stage: deploy
extends:
- .kaniko-root
variables:
CI_CUSTOM_IMAGE_NAME: "odrs"
OCI_TAG: "nginx"
DOCKERFILE: "Dockerfile.nginx"
- when: manual
+ rules:
+ - if: $CI_COMMIT_REF_NAME == "master"
+ when: manual
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]