From 1f74380a2ddbda95dd9567c4937d1d443e83b510 Mon Sep 17 00:00:00 2001
From: chinelo-obitube <obitubec@gmail.com>
Date: Wed, 6 Nov 2024 14:07:35 +0000
Subject: [PATCH] remove after test from unit-tests

---
 .github/workflows/ci-tests.yaml | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml
index c1906d55..87626b65 100644
--- a/.github/workflows/ci-tests.yaml
+++ b/.github/workflows/ci-tests.yaml
@@ -1,4 +1,4 @@
-name: Build and Run Tests
+name: Build and Run Alegre Tests
 
 on:
   # schedule:
@@ -194,7 +194,17 @@ jobs:
         GITHUB_TEST_RESULT: ${{ steps.contract-tests.outcome}}
       run:  |
        docker compose exec alegre coverage xml
-       if [[ "GITHUB_PULL_REQUEST" == "false" && "$GITHUB_JOB_NAME" != "contract-testing" ]]; then ./cc-test-reporter after-build -t coverage.py -r $CC_TEST_REPORTER_ID --exit-code $GITHUB_TEST_RESULT; fi
+      
+    - name: Generat code coverage
+      env:
+        GITHUB_PULL_REQUEST: ${{ github.event_name}}
+        GITHUB_COMMIT_SHA: ${{ github.sha }}
+        GITHUB_JOB_NAME: ${{ github.job }}
+        CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
+        GITHUB_TEST_RESULT: ${{ steps.contract-tests.outcome}}
+      if: github.event_name != 'pull_request' 
+      run:  |
+       ./cc-test-reporter after-build -t coverage.py -r $CC_TEST_REPORTER_ID --exit-code $GITHUB_TEST_RESULT; fi
     
     - name: Cleanup Docker Resources
       run: |