https://github.com/Kitware/CMake
Raw File
Tip revision: 1e26c84b96c0ec6887de2cf5e14061ccb83bdbfe authored by Brad King on 01 July 2020, 11:14:26 UTC
CMake 3.18.0-rc3
Tip revision: 1e26c84
os-macos.yml
# macOS-specific builder configurations and build commands

## Base configurations

.macos:
    variables:
        GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci ext/$CI_CONCURRENT_ID"
        # TODO: Factor this out so that each job selects the Xcode version to
        # use so that different versions can be tested in a single pipeline.
        DEVELOPER_DIR: "/Applications/Xcode-11.5.app/Contents/Developer"

### Build and test

.macos_build:
    extends: .macos

    variables:
        # Note that shell runners only support runners with a single
        # concurrency level. We can't use `$CI_CONCURRENCY_ID` because this may
        # change between the build and test stages which CMake doesn't support.
        # Even if we could, it could change if other runners on the machine
        # could run at the same time, so we drop it.
        GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"

.macos_ninja:
    extends: .macos_build

    variables:
        CMAKE_CONFIGURATION: macos_ninja
        CTEST_NO_WARNINGS_ALLOWED: 1

.macos_makefiles:
    extends: .macos_build

    variables:
        CMAKE_CONFIGURATION: macos_makefiles
        CTEST_NO_WARNINGS_ALLOWED: 1
        CMAKE_GENERATOR: "Unix Makefiles"

### External testing

.macos_xcode:
    extends: .macos

    variables:
        CMAKE_CONFIGURATION: macos_xcode
        CMAKE_GENERATOR: Xcode

## Tags

.macos_builder_tags:
    tags:
        - cmake # Since this is a bare runner, pin to a project.
        - macos
        - shell
        - xcode-11.5
        - nonconcurrent

.macos_builder_ext_tags:
    tags:
        - cmake # Since this is a bare runner, pin to a project.
        - macos
        - shell
        - xcode-11.5
        - concurrent

## macOS-specific scripts

.before_script_macos: &before_script_macos
    - .gitlab/ci/cmake.sh
    - .gitlab/ci/ninja.sh
    - export PATH=$PWD/.gitlab:$PWD/.gitlab/cmake/bin:$PATH
    - cmake --version
    - ninja --version
    # Download Qt
    - cmake -P .gitlab/ci/download_qt.cmake
    - export CMAKE_PREFIX_PATH=$PWD/.gitlab/qt

.cmake_build_macos:
    stage: build

    script:
        - *before_script_macos
        - .gitlab/ci/sccache.sh
        # Allow the server to already be running.
        - "sccache --start-server || :"
        - sccache --show-stats
        - ctest -VV -S .gitlab/ci/ctest_configure.cmake
        - ctest -VV -S .gitlab/ci/ctest_build.cmake
        - sccache --show-stats

    interruptible: true

.cmake_test_macos:
    stage: test

    script:
        - *before_script_macos
        - ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake

    interruptible: true

.cmake_test_macos_external:
    stage: test-ext

    script:
        - *before_script_macos
        - .gitlab/ci/sccache.sh
        # Allow the server to already be running.
        - "sccache --start-server || :"
        - sccache --show-stats
        - "$LAUNCHER build/install/CMake.app/Contents/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_test_external.cmake"
        - sccache --show-stats

    interruptible: true
back to top