Commit bda83cfd authored by Ben Boeckel's avatar Ben Boeckel
Browse files

gitlab-ci: add support for macOS builds

parent b352344b
Pipeline #188165 waiting for manual action with stages
......@@ -5,6 +5,7 @@ include:
# OS builds.
- local: .gitlab/os-linux.yml
- local: .gitlab/os-macos.yml
# Post-build steps
- local: .gitlab/upload.yml
......@@ -157,3 +158,38 @@ test:linux-osmesa-static:
- build:linux-osmesa-static
needs:
- build:linux-osmesa-static
# macOS
## Normal build
build:macos-plain:
extends:
- .macos_plain
- .cmake_build_macos
- .cmake_build_artifacts
- .macos_builder_tags
- .run_manually
test:macos-plain:
extends:
- .macos_plain
- .cmake_test_macos
- .cmake_package_artifacts
- .macos_builder_tags
- .run_automatically
dependencies:
- build:macos-plain
needs:
- build:macos-plain
upload:macos-plain:
extends:
- .rsync_upload
- .upload_only
dependencies:
- test:macos-plain
needs:
- test:macos-plain
variables:
RSYNC_DESTINATION: paraview_nightly_bin
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos.cmake")
# macOS-specific builder configurations and build commands
## Base configurations
.macos:
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/paraview-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/paraview-ci"
.macos_plain:
extends: .macos_build
variables:
CMAKE_CONFIGURATION: macos_plain
CTEST_NO_WARNINGS_ALLOWED: 1
## Tags
.macos_builder_tags:
tags:
- paraview
- macos
- shell
- xcode-11.5
- nonconcurrent
## 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
- "git submodule update --init --recursive || :"
- git submodule foreach --recursive cmake "-Dusername:STRING=$CI_PROJECT_NAMESPACE" "-Durl_prefix:STRING=https://$CI_SERVER_HOST" -P "$PWD/.gitlab/ci/fetch_submodule.cmake"
- git submodule sync --recursive
- git submodule update --init --recursive
.before_script_macos_paraview: &before_script_macos_paraview
- .gitlab/ci/checkout_paraview.sh
- export PARAVIEW_COMMIT_SHA=`git -C $CI_BUILDS_DIR/source-paraview rev-parse HEAD`
- export PARAVIEW_COMMIT_SHORT_SHA=`git -C $CI_BUILDS_DIR/source-paraview rev-parse --short HEAD`
.cmake_build_macos:
stage: build
script:
- *before_script_macos
- *before_script_macos_paraview
- export GIT_CEILING_DIRECTORIES=$PWD
- .gitlab/ci/sccache.sh
- export CC=$PWD/.gitlab/shortcuts/gcc
- export CXX=$PWD/.gitlab/shortcuts/g++
# 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
- ctest -V --output-on-failure -S .gitlab/ci/ctest_package.cmake
- sccache --show-stats
cache:
key: macos
paths:
# Cache downloaded tarballs.
- build/downloads/
interruptible: true
.cmake_test_macos:
stage: test
script:
- *before_script_macos
- ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake
interruptible: true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment