summaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml360
1 files changed, 310 insertions, 50 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0a55ca3..5795af8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,7 +4,7 @@
- tags@cmake/cmake
.fedora31: &fedora31
- image: "kitware/cmake:ci-fedora31-x86_64-2020-05-05"
+ image: "kitware/cmake:ci-fedora31-x86_64-2020-05-08"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/gitlab-kitware-cmake ci"
@@ -21,6 +21,7 @@
variables:
CMAKE_CONFIGURATION: debian10_iwyu
CTEST_NO_WARNINGS_ALLOWED: 1
+ CMake_SKIP_INSTALL: 1
.fedora31_tidy: &fedora31_tidy
extends: .fedora31
@@ -28,6 +29,7 @@
variables:
CMAKE_CONFIGURATION: fedora31_tidy
CTEST_NO_WARNINGS_ALLOWED: 1
+ CMake_SKIP_INSTALL: 1
.fedora31_sphinx: &fedora31_sphinx
extends: .fedora31
@@ -36,25 +38,124 @@
CMAKE_CONFIGURATION: fedora31_sphinx
CTEST_NO_WARNINGS_ALLOWED: 1
CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx"
+ CMake_SKIP_INSTALL: 1
-before_script:
+.fedora31_ninja: &fedora31_ninja
+ extends: .fedora31
+
+ variables:
+ CMAKE_CONFIGURATION: fedora31_ninja
+ CTEST_NO_WARNINGS_ALLOWED: 1
+
+.fedora31_makefiles: &fedora31_makefiles
+ extends: .fedora31
+
+ variables:
+ CMAKE_CONFIGURATION: fedora31_makefiles
+ CTEST_NO_WARNINGS_ALLOWED: 1
+ CMAKE_GENERATOR: "Unix Makefiles"
+
+.macos: &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/gitlab-kitware-cmake ci"
+
+.macos_ninja: &macos_ninja
+ extends: .macos
+
+ variables:
+ CMAKE_CONFIGURATION: macos_ninja
+ CTEST_NO_WARNINGS_ALLOWED: 1
+
+.macos_makefiles: &macos_makefiles
+ extends: .macos
+
+ variables:
+ CMAKE_CONFIGURATION: macos_makefiles
+ CTEST_NO_WARNINGS_ALLOWED: 1
+ CMAKE_GENERATOR: "Unix Makefiles"
+
+.windows: &windows
+ 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.
+ # Blocked on https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/2122
+ #GIT_CLONE_PATH: "$CI_BUILDS_DIR\\gitlab-kitware-cmake ci"
+
+.windows_ninja: &windows_ninja
+ extends: .windows
+
+ variables:
+ # Debug and RelWithDebinfo build types use the `/Zi` which results in
+ # uncacheable compiations.
+ # https://github.com/mozilla/sccache/issues/242
+ CMAKE_BUILD_TYPE: Release
+ CTEST_NO_WARNINGS_ALLOWED: 1
+
+.windows_vs2019_x64_ninja: &windows_vs2019_x64_ninja
+ extends: .windows_ninja
+
+ variables:
+ CMAKE_CONFIGURATION: windows_vs2019_x64_ninja
+ VCVARSALL: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat"
+ VCVARSPLATFORM: x64
+
+.linux_builder_tags: &linux_builder_tags
+ tags:
+ - build
+ - docker
+ - linux
+
+.linux_builder_tags_qt: &linux_builder_tags_qt
+ tags:
+ - build
+ - docker
+ - linux
+ - linux-3.17 # Needed to be able to load Fedora's Qt libraries.
+
+.macos_builder_tags: &macos_builder_tags
+ tags:
+ - cmake # Since this is a bare runner, pin to a project.
+ - macos
+ - shell
+
+.windows_builder_tags: &windows_builder_tags
+ tags:
+ - cmake # Since this is a bare runner, pin to a project.
+ - windows
+ - shell
+
+.before_script_unix: &before_script_unix
- .gitlab/ci/cmake.sh
- .gitlab/ci/ninja.sh
- export PATH=$PWD/.gitlab:$PWD/.gitlab/cmake/bin:$PATH
- cmake --version
- ninja --version
+.before_script_windows: &before_script_windows
+ - Invoke-Expression -Command .gitlab/ci/cmake.ps1
+ - Invoke-Expression -Command .gitlab/ci/ninja.ps1
+ - $pwdpath = $pwd.Path
+ - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$pwdpath\.gitlab\cmake\bin;$env:PATH"
+ - cmake --version
+ - ninja --version
+
.cmake_build_unix: &cmake_build_unix
stage: build
only: *only_settings
- tags:
- - build
- - docker
- - linux
script:
+ - *before_script_unix
- .gitlab/ci/sccache.sh
- - sccache --start-server
+ # Allow the server to already be running.
+ - "sccache --start-server || :"
- sccache --show-stats
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
@@ -62,64 +163,223 @@ before_script:
interruptible: true
-stages:
- - build
- - test
-
-build:debian10-iwyu:
- <<:
- - *debian10_iwyu
+.cmake_build_windows: &cmake_build_windows
stage: build
only: *only_settings
- tags:
- - build
- - docker
- - linux
script:
- - .gitlab/ci/sccache.sh
+ - *before_script_windows
+ - Invoke-Expression -Command .gitlab/ci/sccache.ps1
+ - Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
- sccache --start-server
- sccache --show-stats
- - "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
- - "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
+ - ctest -VV -S .gitlab/ci/ctest_configure.cmake
+ - ctest -VV -S .gitlab/ci/ctest_build.cmake
- sccache --show-stats
+ - sccache --stop-server
+
interruptible: true
-build:fedora31-tidy:
- <<:
- - *fedora31_tidy
- stage: build
+.cmake_build_artifacts: &cmake_build_artifacts
+ artifacts:
+ expire_in: 1d
+ paths:
+ # XXX(globbing): Can be simplified with support from
+ # https://gitlab.com/gitlab-org/gitlab-runner/issues/4840
+ - build/CTestTestfile.cmake
+ - build/*/CTestTestfile.cmake
+ - build/*/*/CTestTestfile.cmake
+ - build/*/*/*/CTestTestfile.cmake
+ - build/*/*/*/*/CTestTestfile.cmake
+
+ # Allow CMake to find CMAKE_ROOT.
+ - build/CMakeFiles/CMakeSourceDir.txt
+
+ # Take the install tree.
+ - build/install/
+
+ # We need the main binaries.
+ - build/bin/
+ # The cache is needed for the installation test.
+ - build/CMakeCache.txt
+ # Test binaries. Eventually these might be better under
+ # `Source/Tests` or the like.
+ - build/Tests/EnforceConfig.cmake
+ - build/Tests/CMakeBuildTest.cmake
+ - build/Tests/CMakeBuildDoubleProjectTest.cmake
+ - build/Tests/CMake*/runcompilecommands
+ - build/Tests/CMake*/runcompilecommands.exe
+ - build/Tests/CMake*/test*
+ - build/Tests/CMake*/PseudoMemcheck/valgrind
+ - build/Tests/CMake*/PseudoMemcheck/purify
+ - build/Tests/CMake*/PseudoMemcheck/memcheck_fail
+ - build/Tests/CMake*/PseudoMemcheck/BC
+ - build/Tests/CMake*/PseudoMemcheck/valgrind.exe
+ - build/Tests/CMake*/PseudoMemcheck/purify.exe
+ - build/Tests/CMake*/PseudoMemcheck/memcheck_fail.exe
+ - build/Tests/CMake*/PseudoMemcheck/BC.exe
+ - build/Tests/CMake*/PseudoMemcheck/NoLog
+ - build/Tests/CMake*Lib/*LibTests
+ - build/Tests/CMake*Lib/*LibTests.exe
+ - build/Source/kwsys/cmsysTest*
+ - build/Source/kwsys/testConsoleBufChild.exe
+ - build/Utilities/cmcurl/curltest
+ - build/Utilities/cmcurl/curltest.exe
+ - build/Utilities/KWIML/test/kwiml_test
+ - build/Utilities/KWIML/test/kwiml_test.exe
+ - build/Source/kwsys/*cmsysTestDynload.*
+ - build/Source/kwsys/dynloaddir/cmsysTestDynloadImpl.dll
+ - build/Source/kwsys/dynloaddir/cmsysTestDynloadUse.dll
+
+ # Test directories.
+ - build/Tests/CTest*
+ - build/Tests/Find*
+ - build/Tests/Qt5*
+ - build/Tests/RunCMake/
+ - build/Tests/CMakeOnly/
+ - build/Tests/CMakeTests/
+
+ # CTest/CDash information.
+ - build/Testing/
+ - build/DartConfiguation.tcl
+ - build/CTestCustom.cmake
+
+.cmake_test_artifacts: &cmake_test_artifacts
+ artifacts:
+ expire_in: 1d
+ paths:
+ # Take the install tree.
+ - build/install/
+
+.cmake_test_unix: &cmake_test_unix
+ stage: test
only: *only_settings
- tags:
- - build
- - docker
- - linux
script:
- - .gitlab/ci/sccache.sh
- - sccache --start-server
- - sccache --show-stats
- - "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
- - "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
- - sccache --show-stats
+ - *before_script_unix
+ - "$LAUNCHER ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake"
+
interruptible: true
-build:fedora31-sphinx:
- <<:
- - *fedora31_sphinx
- stage: build
+.cmake_test_windows: &cmake_test_windows
+ stage: test
only: *only_settings
- tags:
- - build
- - docker
- - linux
- - linux-3.17 # Needed to be able to load Fedora's Qt libraries.
script:
- - .gitlab/ci/sccache.sh
- - sccache --start-server
- - sccache --show-stats
- - "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
- - "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
- - sccache --show-stats
+ - *before_script_windows
+ - Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
+ - ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake
+
interruptible: true
+
+stages:
+ - build
+ - test
+
+build:debian10-iwyu:
+ <<:
+ - *debian10_iwyu
+ - *cmake_build_unix
+ - *linux_builder_tags
+
+build:fedora31-tidy:
+ <<:
+ - *fedora31_tidy
+ - *cmake_build_unix
+ - *linux_builder_tags
+
+build:fedora31-sphinx:
+ <<:
+ - *fedora31_sphinx
+ - *cmake_build_unix
+ - *linux_builder_tags_qt
+
+build:fedora31-ninja:
+ <<:
+ - *fedora31_ninja
+ - *cmake_build_unix
+ - *cmake_build_artifacts
+ - *linux_builder_tags
+ when: manual
+
+test:fedora31-ninja:
+ <<:
+ - *fedora31_ninja
+ - *cmake_test_unix
+ - *linux_builder_tags_qt
+ dependencies:
+ - build:fedora31-ninja
+ needs:
+ - build:fedora31-ninja
+
+build:fedora31-makefiles:
+ <<:
+ - *fedora31_makefiles
+ - *cmake_build_unix
+ - *cmake_build_artifacts
+ - *linux_builder_tags
+ when: manual
+
+test:fedora31-makefiles:
+ <<:
+ - *fedora31_makefiles
+ - *cmake_test_unix
+ - *linux_builder_tags_qt
+ dependencies:
+ - build:fedora31-makefiles
+ needs:
+ - build:fedora31-makefiles
+
+build:macos-ninja:
+ <<:
+ - *macos_ninja
+ - *cmake_build_unix
+ - *cmake_build_artifacts
+ - *macos_builder_tags
+ when: manual
+
+test:macos-ninja:
+ <<:
+ - *macos_ninja
+ - *cmake_test_unix
+ - *macos_builder_tags
+ dependencies:
+ - build:macos-ninja
+ needs:
+ - build:macos-ninja
+
+build:macos-makefiles:
+ <<:
+ - *macos_makefiles
+ - *cmake_build_unix
+ - *cmake_build_artifacts
+ - *macos_builder_tags
+ when: manual
+
+test:macos-makefiles:
+ <<:
+ - *macos_makefiles
+ - *cmake_test_unix
+ - *macos_builder_tags
+ dependencies:
+ - build:macos-makefiles
+ needs:
+ - build:macos-makefiles
+
+build:windows-vs2019-x64-ninja:
+ <<:
+ - *windows_vs2019_x64_ninja
+ - *cmake_build_windows
+ - *cmake_build_artifacts
+ - *windows_builder_tags
+ when: manual
+
+test:windows-vs2019-x64-ninja:
+ <<:
+ - *windows_vs2019_x64_ninja
+ - *cmake_test_windows
+ - *windows_builder_tags
+ dependencies:
+ - build:windows-vs2019-x64-ninja
+ needs:
+ - build:windows-vs2019-x64-ninja