From 5c217623a9230ad60675851b2323ebfd63fbc23c Mon Sep 17 00:00:00 2001
From: Bo-Chun Chen <louistw@uab.edu>
Date: Mon, 5 Feb 2024 20:10:45 -0600
Subject: [PATCH] Test with DEBUG flag with set -x

---
 .gitlab-ci.yml | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 840ff32..a0e00f8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -26,14 +26,20 @@ build-job:       # This job runs in the build stage, which runs first.
   tags:
     - build
   script:
+    - |
+      if [ "$DEBUG" = true ]; do
+        set -x
+      fi
     - echo "Compiling the code..."
     - echo "Compile complete."
-    - set -x
     - |
       echo line1
       echo line2
       echo line3
-    - set +x
+    - |
+      if [ "$DEBUG" = true ]; do 
+        set +x
+      fi
 
 lint-test-job:   # This job also runs in the test stage.
   stage: test    # It can run at the same time as unit-test-job (in parallel).
-- 
GitLab