From 541744260f7aafd9bb7aa96cbf8f218ce8981eac Mon Sep 17 00:00:00 2001
From: Thomas Flori <thflori@gmail.com>
Date: Wed, 3 Apr 2024 01:26:56 +0200
Subject: [PATCH] generate cobertura reports only in php >= 7.3

---
 .gitlab-ci.yml | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 886ffd2..ce41b30 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -32,6 +32,33 @@ phpunit:
         path: coverage/cobertura.xml
   coverage: '/^\s*Lines:\s*\d+.\d+\%/'
 
+  
+phpunit-old:
+  stage: test
+  needs: []
+  parallel:
+    matrix:
+      - PHP_VERSION: ['7.1', '7.2']
+  image: iras/php-composer:${PHP_VERSION}
+  cache:
+    key: php-dependencies-${PHP_VERSION}
+    paths:
+      - ./storage/composer
+  before_script:
+    - export COMPOSER_CACHE_DIR=$(pwd)/storage/composer
+    # basically we are ignoring the composer.lock in tests
+    - composer update --no-interaction --ansi
+  script:
+    - php -dzend_extension=xdebug.so -dxdebug.mode=coverage 
+        vendor/bin/phpunit -c phpunit.xml --color=always 
+          --coverage-text
+          --coverage-html=coverage/html | tee /tmp/phpunit.out
+    - sed -r 's~\x01?(\x1B\(B)?\x1B\[([0-9;]*)?[JKmsu]\x02?~~g' /tmp/phpunit.out|grep '^  Lines'
+  artifacts:
+    paths:
+      - coverage/html
+  coverage: '/^\s*Lines:\s*\d+.\d+\%/'
+
 # quality:
 #   stage: test
 #   needs: []
-- 
GitLab