<commit_before># jobs starting with "." are ignored by gitlab-ci, they are used as anchor, which
# enable to reuse the same code inside multiple jobs. Please see YAML specification
# for more information
.unix_get_superbuild:
  script: &unix_get_superbuild
    - cd ..
    - chmod +x ${CI_PROJECT_DIR}/CI/findRightSuperbuildCache.sh
    - ${CI_PROJECT_DIR}/CI/findRightSuperbuildCache.sh ${OS} ${CI_COMMIT_REF_NAME} ${MINIO_CACHE_SERVER_ADDRESS} ${MINIO_CACHE_SERVER_ACCESS_KEY} ${MINIO_CACHE_SERVER_SECRET_KEY} ${mode}
    # create a symbolic link
    - cd ${CI_PROJECT_DIR}
    - ln -s ../Superbuild-build Superbuild-build

# Currently the OSX job are executed in a shell runner, every folder that is created remains
.OSX_superbuild: &OSX_superbuild
  stage: superbuild
  script:
    - git submodule update --init Superbuild/common-superbuild
    - cd ..
    # prepare directory, on OSX as we use the shell executor we need to remove
    # the old directory
    - rm -rf Superbuild-build/
    - mkdir Superbuild-build/
    - cd Superbuild-build/
    # configure & generate
    - >
      if [ "${mode}" == "full" ]; then
        optional_dependancies="ON"
      else
        optional_dependancies="OFF"
      fi
    - cmake -DCMAKE_BUILD_TYPE:STRING=${cmake_option_CMAKE_BUILD_TYPE}
      -DCMAKE_OSX_ARCHITECTURES:STRING=${cmake_option_CMAKE_OSX_ARCHITECTURES}
      -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${cmake_option_CMAKE_OSX_DEPLOYMENT_TARGET}
      -DCMAKE_OSX_SYSROOT:STRING=${cmake_option_CMAKE_OSX_SYSROOT}
      -DBUILD_TESTING=True
      -DENABLE_all=${optional_dependancies}
      ${CI_PROJECT_DIR}/Superbuild
    # disable darknet on CI because no GPU available
    - cmake -DENABLE_all=False -DENABLE_darknet=False .
    # compile
    - make -j8
    # remove lidarview
    - rm -rf common-superbuild/lidarview
    # upload superbuild, Apple's Zip Utility, which I guess is use by gilab-ci
    # produce corrupted file for large file, so we need to upload the cache manually
    - cd ..
    - echo "compressing and uploading Superbuild. This take some time..."
    - tar jcf archive Superbuild-build/
    - ~/mc config host add superbuild ${MINIO_CACHE_SERVER_ADDRESS} ${MINIO_CACHE_SERVER_ACCESS_KEY} ${MINIO_CACHE_SERVER_SECRET_KEY}
    - ~/mc cp archive superbuild/runner/minio/project/808/${cache_patch}/${OS}/${CI_COMMIT_REF_NAME}-${mode}

.OSX_superbuild_manual: &OSX_superbuild_manual
  when: manual
  <<: *OSX_superbuild
  stage: manual

.OSX_superbuild_schedule: &OSX_superbuild_schedule
  <<: *OSX_superbuild
  only:
    - schedules

.OSX_build: &OSX_build
  stage: build
  extends: .only-important
  before_script: *unix_get_superbuild
  script:
    - git submodule update --init Superbuild/common-superbuild
    - cd ../Superbuild-build/ # created by extracting cache in "unix_get_superbuild"
    - make lidarview -j8

.OSX_test: &OSX_test
  stage: test
  extends: .only-important
  before_script: *unix_get_superbuild
  script:
    # get test data and baseline
    - git submodule update --init Superbuild/common-superbuild
    - git submodule update --init TestData
    - cd ../Superbuild-build/ # created by extracting cache in "unix_get_superbuild"
    - make lidarview -j8
    - cd ../Superbuild-build/common-superbuild/lidarview/build
    - cmake . -DBUILD_TESTING=True
    - make -j8
    # excluding packaging test targets (packaging is done later)
    # TODO current Source related tests fails, so we skip them.
    # This need to be fixed !
    - ctest -E "$test_blacklist"

.OSX_package: &OSX_package
  stage: package
  before_script: *unix_get_superbuild
  script:
    - cd Superbuild-build
    - cd ../Superbuild-build/ # created by extracting cache in "unix_get_superbuild"
    - make lidarview -j8
    - ctest -R cpack

.OSX_package_manual: &OSX_package_manual
  when: manual
  <<: *OSX_package
  stage: manual
  artifacts:
    name: ${CI_JOB_NAME}-${mode}
    paths:
     - ../Superbuild-build/*.tar.gz
     - ../Superbuild-build/*.dmg
    expire_in: 3 day

.OSX_package_schedule: &OSX_package_schedule
  <<: *OSX_package
  artifacts:
    name: ${CI_JOB_NAME}-${mode}
    paths:
     - ../Superbuild-build/*.tar.gz # Superbuild-build links to ../Superbuild-build
     - ../Superbuild-build/*.dmg
    expire_in: 7 day
  only:
    - schedules

#-------------------------------------------------------------------------------
# jobs for OSX ElCapitan
#-------------------------------------------------------------------------------
.OSX_ElCapitan: &OSX_ElCapitan
  tags:
    - OSX_ElCapitan
  variables:
    OS: OSX_ElCapitan
# options specific to macOS builds
    cmake_option_CMAKE_OSX_ARCHITECTURES: "x86_64"
    cmake_option_CMAKE_OSX_DEPLOYMENT_TARGET: "10.10"
    cmake_option_CMAKE_OSX_SYSROOT: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk"

OSX_ElCapitan_build:
  <<: *OSX_ElCapitan
  <<: *OSX_build

OSX_ElCapitan_test:
  <<: *OSX_ElCapitan
  <<: *OSX_test

# For SuperBuild and package
# the "mode" variable should be used for choosing light/full
OSX_ElCapitan_superbuild_manual:
  <<: *OSX_ElCapitan
  <<: *OSX_superbuild_manual

OSX_ElCapitan_superbuild_schedule:
  <<: *OSX_ElCapitan
  <<: *OSX_superbuild_schedule

OSX_ElCapitan_package_manual:
  <<: *OSX_ElCapitan
  <<: *OSX_package_manual

OSX_ElCapitan_package_schedule:
  <<: *OSX_ElCapitan
  <<: *OSX_package_schedule<commit_msg>CI: set CMAKE_OSX_SDK needed for qt5<commit_after># jobs starting with "." are ignored by gitlab-ci, they are used as anchor, which
# enable to reuse the same code inside multiple jobs. Please see YAML specification
# for more information
.unix_get_superbuild:
  script: &unix_get_superbuild
    - cd ..
    - chmod +x ${CI_PROJECT_DIR}/CI/findRightSuperbuildCache.sh
    - ${CI_PROJECT_DIR}/CI/findRightSuperbuildCache.sh ${OS} ${CI_COMMIT_REF_NAME} ${MINIO_CACHE_SERVER_ADDRESS} ${MINIO_CACHE_SERVER_ACCESS_KEY} ${MINIO_CACHE_SERVER_SECRET_KEY} ${mode}
    # create a symbolic link
    - cd ${CI_PROJECT_DIR}
    - ln -s ../Superbuild-build Superbuild-build

# Currently the OSX job are executed in a shell runner, every folder that is created remains
.OSX_superbuild: &OSX_superbuild
  stage: superbuild
  script:
    - git submodule update --init Superbuild/common-superbuild
    # prepare directory
    - cd ..
    - rm -rf Superbuild-build/
    - mkdir Superbuild-build/
    - cd Superbuild-build/
    # configure & generate
    - >
      if [ "${mode}" == "full" ]; then
        optional_dependancies="ON"
      else
        optional_dependancies="OFF"
      fi
    - cmake -DCMAKE_BUILD_TYPE:STRING=${cmake_option_CMAKE_BUILD_TYPE}
      -DCMAKE_OSX_ARCHITECTURES:STRING=${cmake_option_CMAKE_OSX_ARCHITECTURES}
      -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${cmake_option_CMAKE_OSX_DEPLOYMENT_TARGET}
      -DCMAKE_OSX_SYSROOT:STRING=${cmake_option_CMAKE_OSX_SYSROOT}
      -DCMAKE_OSX_SDK:STRING=${cmake_option_CMAKE_OSX_SDK}
      -DBUILD_TESTING=True
      -DENABLE_all=${optional_dependancies}
      ${CI_PROJECT_DIR}/Superbuild
    # disable darknet on CI because no GPU available
    - cmake -DENABLE_all=False -DENABLE_darknet=False .
    # compile
    - make -j8
    # remove lidarview
    - rm -rf common-superbuild/lidarview
    # upload superbuild, Apple's Zip Utility, which I guess is use by gilab-ci
    # produce corrupted file for large file, so we need to upload the cache manually
    - cd ..
    - echo "compressing and uploading Superbuild. This take some time..."
    - tar zcf archive Superbuild-build/
    - ~/mc config host add superbuild ${MINIO_CACHE_SERVER_ADDRESS} ${MINIO_CACHE_SERVER_ACCESS_KEY} ${MINIO_CACHE_SERVER_SECRET_KEY}
    - ~/mc cp archive superbuild/runner/minio/project/808/${cache_patch}/${OS}/${CI_COMMIT_REF_NAME}-${mode}

.OSX_superbuild_manual: &OSX_superbuild_manual
  when: manual
  <<: *OSX_superbuild
  stage: manual

.OSX_superbuild_schedule: &OSX_superbuild_schedule
  <<: *OSX_superbuild
  only:
    - schedules

.OSX_build: &OSX_build
  stage: build
  extends: .only-important
  before_script: *unix_get_superbuild
  script:
    - git submodule update --init Superbuild/common-superbuild
    - cd ../Superbuild-build/ # created by extracting cache in "unix_get_superbuild"
    - make lidarview -j8

.OSX_test: &OSX_test
  stage: test
  extends: .only-important
  before_script: *unix_get_superbuild
  script:
    # get test data and baseline
    - git submodule update --init Superbuild/common-superbuild
    - git submodule update --init TestData
    - cd ../Superbuild-build/ # created by extracting cache in "unix_get_superbuild"
    - make lidarview -j8
    - cd ../Superbuild-build/common-superbuild/lidarview/build
    - cmake . -DBUILD_TESTING=True
    - make -j8
    # excluding packaging test targets (packaging is done later)
    # TODO current Source related tests fails, so we skip them.
    # This need to be fixed !
    - ctest -E "$test_blacklist"

.OSX_package: &OSX_package
  stage: package
  before_script: *unix_get_superbuild
  script:
    - git submodule update --init Superbuild/common-superbuild
    - cd ../Superbuild-build/ # created by extracting cache in "unix_get_superbuild"
    - make lidarview -j8
    - ctest -R cpack

.OSX_package_manual: &OSX_package_manual
  when: manual
  <<: *OSX_package
  stage: manual
  artifacts:
    name: ${CI_JOB_NAME}-${mode}
    paths:
     - ../Superbuild-build/*.tar.gz
     - ../Superbuild-build/*.dmg
    expire_in: 3 day

.OSX_package_schedule: &OSX_package_schedule
  <<: *OSX_package
  artifacts:
    name: ${CI_JOB_NAME}-${mode}
    paths:
     - ../Superbuild-build/*.tar.gz # Superbuild-build links to ../Superbuild-build
     - ../Superbuild-build/*.dmg
    expire_in: 7 day
  only:
    - schedules

#-------------------------------------------------------------------------------
# jobs for OSX ElCapitan
#-------------------------------------------------------------------------------
.OSX_ElCapitan: &OSX_ElCapitan
  tags:
    - OSX_ElCapitan
  variables:
    OS: OSX_ElCapitan
# options specific to macOS builds
    cmake_option_CMAKE_OSX_ARCHITECTURES: "x86_64"
    cmake_option_CMAKE_OSX_DEPLOYMENT_TARGET: "10.10"
    cmake_option_CMAKE_OSX_SDK: "macosx10.12"
    cmake_option_CMAKE_OSX_SYSROOT: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk"


OSX_ElCapitan_build:
  <<: *OSX_ElCapitan
  <<: *OSX_build

OSX_ElCapitan_test:
  <<: *OSX_ElCapitan
  <<: *OSX_test

# For SuperBuild and package
# the "mode" variable should be used for choosing light/full
OSX_ElCapitan_superbuild_manual:
  <<: *OSX_ElCapitan
  <<: *OSX_superbuild_manual

OSX_ElCapitan_superbuild_schedule:
  <<: *OSX_ElCapitan
  <<: *OSX_superbuild_schedule

OSX_ElCapitan_package_manual:
  <<: *OSX_ElCapitan
  <<: *OSX_package_manual

OSX_ElCapitan_package_schedule:
  <<: *OSX_ElCapitan
  <<: *OSX_package_schedule
{'fraction_non_alphanumeric': 0.12544835831877127, 'fraction_numerical': 0.004506575922008645, 'mean_word_length': 3.169478527607362, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1738093', 'n_tokens_mistral': 3842, 'n_tokens_neox': 3704, 'n_words': 811}