ci: Add warning icons in GL pipelines
This commit is contained in:
parent
af06da04fd
commit
1a0ca75fc8
@ -117,6 +117,10 @@ stages:
|
||||
variables:
|
||||
CMAKE_VERSION: "3.13.5"
|
||||
|
||||
.warning_policy:
|
||||
allow_failure:
|
||||
exit_codes: [ 47 ]
|
||||
|
||||
.install_cmake: &install_cmake |
|
||||
export PATH=$PWD/.gitlab/cmake/bin:$PATH
|
||||
.gitlab/ci/config/cmake.sh "$CMAKE_VERSION"
|
||||
@ -141,8 +145,10 @@ stages:
|
||||
script:
|
||||
- "ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
||||
- sccache --show-stats
|
||||
- cmake -P .gitlab/ci/check_warnings.cmake || exit 47
|
||||
extends:
|
||||
- .cmake_build_artifacts
|
||||
- .warning_policy
|
||||
|
||||
.cmake_test_linux: &cmake_test_linux
|
||||
stage: test
|
||||
@ -192,6 +198,7 @@ stages:
|
||||
# CTest and CMake install files.
|
||||
# Note: this also captures our CIState.cmake file
|
||||
- build/CMakeCache.txt
|
||||
- build/compile_num_warnings.log
|
||||
- build/**/*.cmake
|
||||
- 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()
|
||||
ctest_submit(PARTS Build)
|
||||
endif()
|
||||
|
||||
|
||||
endif()
|
||||
|
||||
file(WRITE "${CTEST_BINARY_DIRECTORY}/compile_num_warnings.log" "${num_warnings}")
|
||||
|
||||
if (build_result)
|
||||
message(FATAL_ERROR
|
||||
"Failed to build")
|
||||
message(FATAL_ERROR "Failed to build")
|
||||
endif ()
|
||||
|
@ -56,11 +56,13 @@ test:macos_xcode13:
|
||||
- "ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
||||
script:
|
||||
- "ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
||||
- cmake -P .gitlab/ci/check_warnings.cmake || exit 47
|
||||
after_script:
|
||||
- ccache -v -s
|
||||
- ccache -z
|
||||
extends:
|
||||
- .cmake_build_artifacts
|
||||
- .warning_policy
|
||||
|
||||
.cmake_test_macos:
|
||||
stage: test
|
||||
|
@ -17,7 +17,7 @@
|
||||
variables:
|
||||
VCVARSALL: "${VS160COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
|
||||
VCVARSPLATFORM: "x64"
|
||||
VCVARSVERSION: "14.25"
|
||||
VCVARSVERSION: "14.28.29333"
|
||||
|
||||
.cmake_build_windows: &cmake_build_windows
|
||||
extends:
|
||||
@ -40,6 +40,8 @@
|
||||
- "ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
||||
script:
|
||||
- "ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
||||
- "cmake -P .gitlab/ci/check_warnings.cmake"
|
||||
- if (!$?) { $host.SetShouldExit(47); exit 47 }
|
||||
after_script:
|
||||
# This is needed since sometimes this process hangs holding files
|
||||
# in the build directory. Blocking new builds
|
||||
@ -58,6 +60,7 @@
|
||||
# CTest and CMake install files.
|
||||
# Note: this also captures our CIState.cmake file
|
||||
- build/CMakeCache.txt
|
||||
- build/compile_num_warnings.log
|
||||
- build/**/*.cmake
|
||||
- build/Testing/
|
||||
|
||||
@ -98,6 +101,7 @@ build:windows_vs2019:
|
||||
extends:
|
||||
- .cmake_build_windows
|
||||
- .run_automatically
|
||||
- .warning_policy
|
||||
variables:
|
||||
CMAKE_GENERATOR: "Ninja"
|
||||
CMAKE_BUILD_TYPE: Release
|
||||
|
Loading…
Reference in New Issue
Block a user