mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 01:49:02 +00:00
ci: Add warning icons in GL pipelines
This commit is contained in:
parent
af06da04fd
commit
1a0ca75fc8
@ -117,6 +117,10 @@ stages:
|
|||||||
variables:
|
variables:
|
||||||
CMAKE_VERSION: "3.13.5"
|
CMAKE_VERSION: "3.13.5"
|
||||||
|
|
||||||
|
.warning_policy:
|
||||||
|
allow_failure:
|
||||||
|
exit_codes: [ 47 ]
|
||||||
|
|
||||||
.install_cmake: &install_cmake |
|
.install_cmake: &install_cmake |
|
||||||
export PATH=$PWD/.gitlab/cmake/bin:$PATH
|
export PATH=$PWD/.gitlab/cmake/bin:$PATH
|
||||||
.gitlab/ci/config/cmake.sh "$CMAKE_VERSION"
|
.gitlab/ci/config/cmake.sh "$CMAKE_VERSION"
|
||||||
@ -141,8 +145,10 @@ stages:
|
|||||||
script:
|
script:
|
||||||
- "ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
- "ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
||||||
- sccache --show-stats
|
- sccache --show-stats
|
||||||
|
- cmake -P .gitlab/ci/check_warnings.cmake || exit 47
|
||||||
extends:
|
extends:
|
||||||
- .cmake_build_artifacts
|
- .cmake_build_artifacts
|
||||||
|
- .warning_policy
|
||||||
|
|
||||||
.cmake_test_linux: &cmake_test_linux
|
.cmake_test_linux: &cmake_test_linux
|
||||||
stage: test
|
stage: test
|
||||||
@ -192,6 +198,7 @@ stages:
|
|||||||
# CTest and CMake install files.
|
# CTest and CMake install files.
|
||||||
# Note: this also captures our CIState.cmake file
|
# Note: this also captures our CIState.cmake file
|
||||||
- build/CMakeCache.txt
|
- build/CMakeCache.txt
|
||||||
|
- build/compile_num_warnings.log
|
||||||
- build/**/*.cmake
|
- build/**/*.cmake
|
||||||
- build/Testing/
|
- build/Testing/
|
||||||
|
|
||||||
|
31
.gitlab/ci/check_warnings.cmake
Normal file
31
.gitlab/ci/check_warnings.cmake
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
##=============================================================================
|
||||||
|
##
|
||||||
|
## Copyright (c) Kitware, Inc.
|
||||||
|
## All rights reserved.
|
||||||
|
## See LICENSE.txt for details.
|
||||||
|
##
|
||||||
|
## This software is distributed WITHOUT ANY WARRANTY; without even
|
||||||
|
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
## PURPOSE. See the above copyright notice for more information.
|
||||||
|
##
|
||||||
|
##=============================================================================
|
||||||
|
|
||||||
|
# Find the path the logs from the last configure
|
||||||
|
set(cnf_log_path "${CMAKE_SOURCE_DIR}/build/Testing/Temporary/LastConfigure*.log")
|
||||||
|
file(GLOB cnf_log_files ${cnf_log_path})
|
||||||
|
|
||||||
|
foreach(file IN LISTS cnf_log_files)
|
||||||
|
file(STRINGS ${file} lines)
|
||||||
|
string(FIND "${lines}" "Warning" line)
|
||||||
|
if (NOT ${line} EQUAL "-1")
|
||||||
|
message(FATAL_ERROR "Configure warnings detected, please check cdash-commit job")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# `compile_num_warnings` contains a single integer symbolizing the number of
|
||||||
|
# warnings of the last build.
|
||||||
|
set(bld_log_path "${CMAKE_SOURCE_DIR}/build/compile_num_warnings.log")
|
||||||
|
file(STRINGS "${bld_log_path}" output)
|
||||||
|
if (NOT "${output}" STREQUAL "0")
|
||||||
|
message(FATAL_ERROR "Build warnings detected, please check cdash-commit job")
|
||||||
|
endif()
|
@ -30,11 +30,10 @@ if(NOT DEFINED ENV{GITLAB_CI_EMULATION})
|
|||||||
else()
|
else()
|
||||||
ctest_submit(PARTS Build)
|
ctest_submit(PARTS Build)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
file(WRITE "${CTEST_BINARY_DIRECTORY}/compile_num_warnings.log" "${num_warnings}")
|
||||||
|
|
||||||
if (build_result)
|
if (build_result)
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR "Failed to build")
|
||||||
"Failed to build")
|
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -56,11 +56,13 @@ test:macos_xcode13:
|
|||||||
- "ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
- "ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
||||||
script:
|
script:
|
||||||
- "ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
- "ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
||||||
|
- cmake -P .gitlab/ci/check_warnings.cmake || exit 47
|
||||||
after_script:
|
after_script:
|
||||||
- ccache -v -s
|
- ccache -v -s
|
||||||
- ccache -z
|
- ccache -z
|
||||||
extends:
|
extends:
|
||||||
- .cmake_build_artifacts
|
- .cmake_build_artifacts
|
||||||
|
- .warning_policy
|
||||||
|
|
||||||
.cmake_test_macos:
|
.cmake_test_macos:
|
||||||
stage: test
|
stage: test
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
variables:
|
variables:
|
||||||
VCVARSALL: "${VS160COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
|
VCVARSALL: "${VS160COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
|
||||||
VCVARSPLATFORM: "x64"
|
VCVARSPLATFORM: "x64"
|
||||||
VCVARSVERSION: "14.25"
|
VCVARSVERSION: "14.28.29333"
|
||||||
|
|
||||||
.cmake_build_windows: &cmake_build_windows
|
.cmake_build_windows: &cmake_build_windows
|
||||||
extends:
|
extends:
|
||||||
@ -40,6 +40,8 @@
|
|||||||
- "ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
- "ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
||||||
script:
|
script:
|
||||||
- "ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
- "ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
||||||
|
- "cmake -P .gitlab/ci/check_warnings.cmake"
|
||||||
|
- if (!$?) { $host.SetShouldExit(47); exit 47 }
|
||||||
after_script:
|
after_script:
|
||||||
# This is needed since sometimes this process hangs holding files
|
# This is needed since sometimes this process hangs holding files
|
||||||
# in the build directory. Blocking new builds
|
# in the build directory. Blocking new builds
|
||||||
@ -58,6 +60,7 @@
|
|||||||
# CTest and CMake install files.
|
# CTest and CMake install files.
|
||||||
# Note: this also captures our CIState.cmake file
|
# Note: this also captures our CIState.cmake file
|
||||||
- build/CMakeCache.txt
|
- build/CMakeCache.txt
|
||||||
|
- build/compile_num_warnings.log
|
||||||
- build/**/*.cmake
|
- build/**/*.cmake
|
||||||
- build/Testing/
|
- build/Testing/
|
||||||
|
|
||||||
@ -98,6 +101,7 @@ build:windows_vs2019:
|
|||||||
extends:
|
extends:
|
||||||
- .cmake_build_windows
|
- .cmake_build_windows
|
||||||
- .run_automatically
|
- .run_automatically
|
||||||
|
- .warning_policy
|
||||||
variables:
|
variables:
|
||||||
CMAKE_GENERATOR: "Ninja"
|
CMAKE_GENERATOR: "Ninja"
|
||||||
CMAKE_BUILD_TYPE: Release
|
CMAKE_BUILD_TYPE: Release
|
||||||
|
Loading…
Reference in New Issue
Block a user