From 15362bd9a03db9882576a9486a2ff9ffa3a99a7f Mon Sep 17 00:00:00 2001
From: Jithu Murugan <j.murugan@fz-juelich.de>
Date: Mon, 24 Feb 2025 15:55:36 +0100
Subject: [PATCH] - Fixed the failing merge_coverage job by ensuring the
 required coverage package is installed. Moved the common before_script to the
 default section. - Added the test coverage badge to README.md.

---
 .gitlab-ci.yml | 15 +++++----------
 README.md      |  2 ++
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 57460e7..003ac77 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,11 @@ stages:
 variables:
   BUILD_ENV_DOCKER_IMAGE: docker-registry.ebrains.eu/esd/tmp:latest
 
+default:
+  before_script:
+    - chmod +x dedal/utils/bootstrap.sh
+    - ./dedal/utils/bootstrap.sh
+    - pip install -e .[test]
 
 build-wheel:
   stage: build
@@ -27,10 +32,6 @@ unit_tests:
   tags:
     - docker-runner
   image: ubuntu:22.04
-  before_script:
-    - chmod +x dedal/utils/bootstrap.sh
-    - ./dedal/utils/bootstrap.sh
-    - pip install -e .[test]
   script:
     - coverage run -m pytest -s --tb=short --junitxml=test-results.xml ./dedal/tests/unit_tests
     - coverage xml -o coverage_unit.xml
@@ -48,10 +49,6 @@ integration_tests:
   tags:
     - docker-runner
   image: ubuntu:22.04
-  before_script:
-    - chmod +x dedal/utils/bootstrap.sh
-    - ./dedal/utils/bootstrap.sh
-    - pip install -e .[test]
   script:
     - coverage run -m pytest -s --tb=short --junitxml=test-results.xml ./dedal/tests/integration_tests
     - coverage xml -o coverage_integration.xml
@@ -70,8 +67,6 @@ merge_coverage:
   tags:
     - docker-runner
   image: ubuntu:22.04
-  before_script:
-    - pip install coverage
   script:
     - coverage combine coverage_unit.xml coverage_integration.xml
     - coverage report
diff --git a/README.md b/README.md
index dd68dcf..df769fe 100644
--- a/README.md
+++ b/README.md
@@ -51,3 +51,5 @@ The lowest ```spack version``` compatible with this library is ```v0.23.0```.
 
 For both concretization and binary caches, the cache version can be changed via the attributes ```cache_version_concretize``` and ```cache_version_build```. 
 The default values are ```v1```.
+
+![Coverage Badge](https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/yashchiki/badges/koutakia/coverage.svg)
-- 
GitLab