From 066848c1d9dfb9fb59fa608ed085b5d4e3cfff5b Mon Sep 17 00:00:00 2001
From: Florian Uhlig <f.uhlig@gsi.de>
Date: Mon, 24 Aug 2020 15:28:08 +0200
Subject: [PATCH] Improve Continuous Intergration

Implement CI also for macOS. Test merge requests on our macOS 10.13 test system.
The pipline now consists of two steps with three different jobs. First the compliance
with the code formating rules is checked. If this step succeed the code is build and
tested on Linux and macOS. This step runs simultaneous on both platforms.
---
 .gitlab-ci.yml | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 19ca9411..cef767d7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -115,6 +115,39 @@ CbmRoot_Merge:
     - cat Dart.cfg
     - $PWD/Dart.sh MergeRequest Dart.cfg
 
+CbmRoot_Merge_macosx:
+  stage: build
+  tags:
+    - CbmRoot_macosx
+  only:
+    refs:
+      - merge_requests
+    variables:
+      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
+  script:
+    - echo $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH
+    - echo $CI_MERGE_REQUEST_PROJECT_PATH
+    - if [ "$CI_MERGE_REQUEST_PROJECT_PATH" != "computing/cbmroot" ]; then
+    -   echo "Should not come here"
+    -   exit 1
+    - fi
+    - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
+    - echo $CI_MERGE_REQUEST_ID
+    - echo $CI_MERGE_REQUEST_IID
+    - echo "export LINUX_FLAVOUR=macOS_10.13" >> Dart.cfg
+    - echo "export FAIRSOFT_VERSION=jun19p1" >> Dart.cfg
+    - echo "export FAIRROOT_VERSION=v18.2.0" >> Dart.cfg
+    - echo "export SIMPATH=/opt/fairsoft/\${FAIRSOFT_VERSION}" >> Dart.cfg
+    - echo "export FAIRROOTPATH=/opt/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
+    - echo "export BUILDDIR=$PWD/build" >> Dart.cfg
+    - echo "export SOURCEDIR=$PWD" >> Dart.cfg
+    - echo "export NCPU=4" >> Dart.cfg
+    - echo "export PATH=\$SIMPATH/bin:$PATH" >> Dart.cfg
+    - ls
+    - pwd
+    - cat Dart.cfg
+    - $PWD/Dart.sh MergeRequest Dart.cfg
+
 pages:
   stage: documentation
   image: alpine
-- 
GitLab