From 880805302669ca6b4c3fcafbe560f7bfd55c4451 Mon Sep 17 00:00:00 2001
From: AlQuemist <alquemist@Lyriks>
Date: Tue, 21 Mar 2023 17:32:27 +0100
Subject: [PATCH] GitLab-CI: rename jobs and tags for Mac CI-machines + minor
 improvements [MacOS]

---
 .gitlab-ci.yml | 37 +++++++++++++++----------------------
 1 file changed, 15 insertions(+), 22 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c89ad82..8c3bf19 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,43 +1,36 @@
 stages:
   - build
 
-mac10_15:
+mac_x64:
   tags:
-  - macbuild3
+  - mac_x64
   stage: build
-  script:
+  before_script:
+    - QTDIR=/usr/local/opt/qt
+  script: &mac_script
     # show system info
     - system_profiler SPSoftwareDataType
+    - OPTDIR=/Users/Shared/Software
     - mkdir build
     - cd build
-    - export QTDIR=/usr/local/Cellar/qt/6.3.0
-    - cmake .. -DCMAKE_PREFIX_PATH="$QTDIR/lib/cmake"
+    - cmake -S .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$OPTDIR" -DCMAKE_PREFIX_PATH="$OPTDIR;$QTDIR/lib/cmake"
     - make
     - ctest --output-on-failure
+    - if [ "$CI_COMMIT_REF_NAME" == "main" ]; then make install; fi
     # - cpack .
-  artifacts:
+  artifacts: &mac_artifacts
     paths:
     # - build/*zip
     expire_in: 10 days
 
-mac12_2:
+mac_arm:
   tags:
-  - scgmac4
+  - mac_arm
   stage: build
-  script:
-    # show system info
-    - system_profiler SPSoftwareDataType
-    - mkdir build
-    - cd build
-    - export QTDIR=/opt/homebrew/Cellar/qt/6.3.0
-    - cmake .. -DCMAKE_PREFIX_PATH="$QTDIR/lib/cmake"
-    - make
-    - ctest --output-on-failure
-    # - cpack .
-  artifacts:
-    paths:
-    # - build/*zip
-    expire_in: 10 days
+  before_script:
+    - QTDIR=/opt/homebrew/opt/qt
+  script: *mac_script
+  artifacts: *mac_artifacts
 
 windows:
   tags:
-- 
GitLab