From a1ad050bfed3e6c06d415091e277f94b11728669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 16 Dec 2021 12:24:53 +0100 Subject: [PATCH 1/2] Try M1 --- .gitlab-ci.yml | 99 ++++++++++++---------------- CI/gitlab-ci/mac-m1-template-job.yml | 20 ++++++ CI/gitlab-ci/mac.yml | 4 ++ 3 files changed, 66 insertions(+), 57 deletions(-) create mode 100644 CI/gitlab-ci/mac-m1-template-job.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fec63f75..67e46abf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -840,6 +840,48 @@ macos-cpp14-release: # - build-release-cpp14/Unittests/report-doublevec.xml +#----------- Job Informations: +# Type: Build+Test: debug +# OS: Mac +# Language: cpp14 + +macos-M1-cpp14-debug: + stage: build + script: "CI/ci-mac-build.sh cpp14 debug ; CI/ci-mac-test.sh cpp14 debug" + tags: + - AppleM1 + artifacts: + paths: + - build-debug-cpp14/*.dmg + - build-debug-cpp14/*.tar.gz +# reports: +# junit: +# - build-debug-cpp14/Unittests/report.xml +# - build-debug-cpp14/Unittests/report-customvec.xml +# - build-debug-cpp14/Unittests/report-doublevec.xml + +#----------- Job Informations: +# Type: Build+Test: release +# OS: Mac +# Language: cpp14 + +macos-M1-cpp14-release: + stage: build + script: "CI/ci-mac-build.sh cpp14 release ; CI/ci-mac-test.sh cpp14 release" + tags: + - AppleM1 + artifacts: + paths: + - build-release-cpp14/*.dmg + - build-release-cpp14/*.tar.gz +# reports: +# junit: +# - build-release-cpp14/Unittests/report.xml +# - build-release-cpp14/Unittests/report-customvec.xml +# - build-release-cpp14/Unittests/report-doublevec.xml + + + # ----------------- # Windows tasks @@ -902,63 +944,6 @@ build-VS2019-x64-shared-FALSE-apps: - build-release/unittests/report-doublevec.xml -#------------- Job Informations: -# Type: Build+Test: Release -# OS: Windows -# Architecture: x64 -# Shared: TRUE -# VS Version: VS2019 -# Apps: {{APPS}} - -build-VS2019-x64-shared-TRUE-apps: - stage: build - variables: - BUILD_PLATFORM: "VS2019" - ARCHITECTURE: "x64" - SHARED: "TRUE" - APPS: "ON" - script: "CI\\Windows.bat" - tags: - - VS2019 - - Qt5150 - artifacts: - paths: - - build-release/*.exe - reports: - junit: - - build-release/unittests/report.xml - - build-release/unittests/report-customvec.xml - - build-release/unittests/report-doublevec.xml - -#------------- Job Informations: -# Type: Build+Test: Release -# OS: Windows -# Architecture: x64 -# Shared: FALSE -# VS Version: VS2019 -# Apps: {{APPS}} - -build-VS2019-x64-shared-FALSE-apps: - stage: build - variables: - BUILD_PLATFORM: "VS2019" - ARCHITECTURE: "x64" - SHARED: "FALSE" - APPS: "ON" - script: "CI\\Windows.bat" - tags: - - VS2019 - - Qt5150 - artifacts: - paths: - - build-release/*.exe - reports: - junit: - - build-release/unittests/report.xml - - build-release/unittests/report-customvec.xml - - build-release/unittests/report-doublevec.xml - - #------------- Job Informations: # Type: Build+Test: Release # OS: Windows diff --git a/CI/gitlab-ci/mac-m1-template-job.yml b/CI/gitlab-ci/mac-m1-template-job.yml new file mode 100644 index 00000000..bc65e997 --- /dev/null +++ b/CI/gitlab-ci/mac-m1-template-job.yml @@ -0,0 +1,20 @@ +#----------- Job Informations: +# Type: Build+Test: {{BUILDTYPE}} +# OS: Mac +# Language: {{LANGUAGE}} + +macos-M1-{{LANGUAGE}}-{{BUILDTYPE}}: + stage: build + script: "CI/ci-mac-build.sh {{LANGUAGE}} {{BUILDTYPE}} ; CI/ci-mac-test.sh {{LANGUAGE}} {{BUILDTYPE}}" + tags: + - AppleM1 + artifacts: + paths: + - build-{{BUILDTYPE}}-{{LANGUAGE}}/*.dmg + - build-{{BUILDTYPE}}-{{LANGUAGE}}/*.tar.gz +# reports: +# junit: +# - build-{{BUILDTYPE}}-{{LANGUAGE}}/Unittests/report.xml +# - build-{{BUILDTYPE}}-{{LANGUAGE}}/Unittests/report-customvec.xml +# - build-{{BUILDTYPE}}-{{LANGUAGE}}/Unittests/report-doublevec.xml + diff --git a/CI/gitlab-ci/mac.yml b/CI/gitlab-ci/mac.yml index 208cda0c..57d973c2 100644 --- a/CI/gitlab-ci/mac.yml +++ b/CI/gitlab-ci/mac.yml @@ -8,3 +8,7 @@ {mac-template-job.yml, BUILDTYPE=debug, LANGUAGE=cpp14} {mac-template-job.yml, BUILDTYPE=release, LANGUAGE=cpp14} +{mac-m1-template-job.yml, BUILDTYPE=debug, LANGUAGE=cpp14} +{mac-m1-template-job.yml, BUILDTYPE=release, LANGUAGE=cpp14} + + From 31609d22e7a24dd463cdf4dd2819055a251ea21b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 16 Dec 2021 12:36:03 +0100 Subject: [PATCH 2/2] Set qt version to 6 for M12 macs --- .gitlab-ci.yml | 4 +- CI/ci-mac-M1-build.sh | 63 +++++++++++++++++++++++++++ CI/ci-mac-M1-prepare.sh | 42 ++++++++++++++++++ CI/ci-mac-M1-test.sh | 65 ++++++++++++++++++++++++++++ CI/gitlab-ci/mac-m1-template-job.yml | 2 +- 5 files changed, 173 insertions(+), 3 deletions(-) create mode 100755 CI/ci-mac-M1-build.sh create mode 100755 CI/ci-mac-M1-prepare.sh create mode 100755 CI/ci-mac-M1-test.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67e46abf..3e6b9399 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -847,7 +847,7 @@ macos-cpp14-release: macos-M1-cpp14-debug: stage: build - script: "CI/ci-mac-build.sh cpp14 debug ; CI/ci-mac-test.sh cpp14 debug" + script: "CI/ci-mac-M1-build.sh cpp14 debug ; CI/ci-mac-M1-test.sh cpp14 debug" tags: - AppleM1 artifacts: @@ -867,7 +867,7 @@ macos-M1-cpp14-debug: macos-M1-cpp14-release: stage: build - script: "CI/ci-mac-build.sh cpp14 release ; CI/ci-mac-test.sh cpp14 release" + script: "CI/ci-mac-M1-build.sh cpp14 release ; CI/ci-mac-M1-test.sh cpp14 release" tags: - AppleM1 artifacts: diff --git a/CI/ci-mac-M1-build.sh b/CI/ci-mac-M1-build.sh new file mode 100755 index 00000000..d8e9ed48 --- /dev/null +++ b/CI/ci-mac-M1-build.sh @@ -0,0 +1,63 @@ +#!/bin/bash +source CI/ci-mac-M1-prepare.sh + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Basic configuration details:" +echo "======================================================================" +echo -e "${NC}" + +echo "Options: $OPTIONS" +echo "BuildPath: $BUILDPATH" +echo "Path: $PATH" +echo "Language: $LANGUAGE" + +cmake --version + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Building $BUILD_TYPE version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" + + +if [ ! -d build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks ]; then + mkdir build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks +fi + +cd build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks + +cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../ + +#build it +make + +cd .. + +if [ "$BUILD_TYPE_L" == "release" ]; then + + echo -e "${OUTPUT}" + echo "" + echo "======================================================================" + echo "Package creation (DMG and tarball)" + echo "======================================================================" + echo -e "${NC}" + + + if [ ! -d build-release-$BUILDPATH ]; then + mkdir build-release-$BUILDPATH + fi + + cd build-release-$BUILDPATH + + cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_APPS=OFF -DCPACK_BINARY_DRAGNDROP=ON $OPTIONS ../ + + #build it + make + make package + + cd .. + +fi diff --git a/CI/ci-mac-M1-prepare.sh b/CI/ci-mac-M1-prepare.sh new file mode 100755 index 00000000..ce5505a7 --- /dev/null +++ b/CI/ci-mac-M1-prepare.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#Exit on any error +set -e + +LANGUAGE=$1 +BUILD_TYPE=$2 + +PATH=$PATH:/opt/local/bin +export PATH + +OPTIONS="" + +# set qt version path +OPTIONS="$OPTIONS -DQT_VERSION=6" + + + +if [ "$LANGUAGE" == "cpp11" ]; then + echo "Building with C++11"; + OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++11' " + BUILDPATH="cpp11" +elif [ "$LANGUAGE" == "cpp14" ]; then + echo "Building with C++14"; + OPTIONS="$OPTIONS -DCMAKE_CXX_FLAGS='-std=c++14' " + BUILDPATH="cpp14" +fi + +#===================================== +# Color Settings: +#===================================== +NC='\033[0m' +OUTPUT='\033[0;32m' +WARNING='\033[0;93m' + +if [ "$BUILD_TYPE" == "release" ]; then + export BUILD_TYPE=Release + export BUILD_TYPE_L=release +else + export BUILD_TYPE=Debug + export BUILD_TYPE_L=debug +fi diff --git a/CI/ci-mac-M1-test.sh b/CI/ci-mac-M1-test.sh new file mode 100755 index 00000000..eee6306d --- /dev/null +++ b/CI/ci-mac-M1-test.sh @@ -0,0 +1,65 @@ +#!/bin/bash +source CI/ci-mac-M1-prepare.sh + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Basic configuration details:" +echo "======================================================================" +echo -e "${NC}" + +echo "Options: $OPTIONS" +echo "BuildPath: $BUILDPATH" +echo "Path: $PATH" +echo "Language: $LANGUAGE" + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Building $BUILD_TYPE version unittests" +echo "======================================================================" +echo -e "${NC}" + + +if [ ! -d build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks ]; then + mkdir build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks +fi + +cd build-$BUILD_TYPE_L-$BUILDPATH-Vector-Checks + +#build the unit tests +make unittests + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running unittests $BUILD_TYPE version with vectorchecks enabled" +echo "======================================================================" +echo -e "${NC}" + +cd Unittests + +#execute tests +./unittests --gtest_color=yes --gtest_output=xml:./report.xml + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running unittests $BUILD_TYPE version with minimal vector type" +echo "======================================================================" +echo -e "${NC}" + +./unittests_customvec --gtest_color=yes --gtest_output=xml:./report-customvec.xml + +echo -e "${OUTPUT}" +echo "" +echo "======================================================================" +echo "Running unittests $BUILD_TYPE version with double vector type" +echo "======================================================================" +echo -e "${NC}" + +#execute tests +./unittests_doublevec --gtest_color=yes --gtest_output=xml:./report-doublevec.xml + +cd .. +cd .. diff --git a/CI/gitlab-ci/mac-m1-template-job.yml b/CI/gitlab-ci/mac-m1-template-job.yml index bc65e997..f1606670 100644 --- a/CI/gitlab-ci/mac-m1-template-job.yml +++ b/CI/gitlab-ci/mac-m1-template-job.yml @@ -5,7 +5,7 @@ macos-M1-{{LANGUAGE}}-{{BUILDTYPE}}: stage: build - script: "CI/ci-mac-build.sh {{LANGUAGE}} {{BUILDTYPE}} ; CI/ci-mac-test.sh {{LANGUAGE}} {{BUILDTYPE}}" + script: "CI/ci-mac-M1-build.sh {{LANGUAGE}} {{BUILDTYPE}} ; CI/ci-mac-M1-test.sh {{LANGUAGE}} {{BUILDTYPE}}" tags: - AppleM1 artifacts: