build: don't check environment variable to detect CI (#22234)

Instead use the cmake option, which should act as the definitive source
to determine whether we use CI or not.
This commit is contained in:
dundargoc 2023-02-12 14:42:00 +01:00 committed by GitHub
parent c099836168
commit f573fcbc0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View File

@ -1,13 +1,5 @@
# Set LC_ALL to meet expectations of some locale-sensitive tests. # Set LC_ALL to meet expectations of some locale-sensitive tests.
set(ENV{LC_ALL} "en_US.UTF-8") set(ENV{LC_ALL} "en_US.UTF-8")
if(POLICY CMP0012)
# Avoid policy warning due to CI=true. This is needed even if the main
# project has already set this policy as project settings aren't inherited
# when using cmake script mode (-P).
cmake_policy(SET CMP0012 NEW)
endif()
set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime) set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)
set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest) set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest)
set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config) set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config)
@ -99,7 +91,7 @@ if(NOT res EQUAL 0)
endif() endif()
# Dump the logfile on CI (if not displayed and moved already). # Dump the logfile on CI (if not displayed and moved already).
if($ENV{CI}) if(CI_BUILD)
if(EXISTS $ENV{NVIM_LOG_FILE} AND NOT EXISTS $ENV{NVIM_LOG_FILE}.displayed) if(EXISTS $ENV{NVIM_LOG_FILE} AND NOT EXISTS $ENV{NVIM_LOG_FILE}.displayed)
file(READ $ENV{NVIM_LOG_FILE} out) file(READ $ENV{NVIM_LOG_FILE} out)
message(STATUS "$NVIM_LOG_FILE: $ENV{NVIM_LOG_FILE}\n${out}") message(STATUS "$NVIM_LOG_FILE: $ENV{NVIM_LOG_FILE}\n${out}")

View File

@ -26,6 +26,7 @@ if(BUSTED_PRG)
-D BUILD_DIR=${CMAKE_BINARY_DIR} -D BUILD_DIR=${CMAKE_BINARY_DIR}
-D TEST_TYPE=unit -D TEST_TYPE=unit
-D CIRRUS_CI=$ENV{CIRRUS_CI} -D CIRRUS_CI=$ENV{CIRRUS_CI}
-D CI_BUILD=${CI_BUILD}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${UNITTEST_PREREQS} DEPENDS ${UNITTEST_PREREQS}
USES_TERMINAL) USES_TERMINAL)
@ -50,6 +51,7 @@ if(BUSTED_PRG)
-D DEPS_PREFIX=${DEPS_PREFIX} -D DEPS_PREFIX=${DEPS_PREFIX}
-D TEST_TYPE=functional -D TEST_TYPE=functional
-D CIRRUS_CI=$ENV{CIRRUS_CI} -D CIRRUS_CI=$ENV{CIRRUS_CI}
-D CI_BUILD=${CI_BUILD}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${FUNCTIONALTEST_PREREQS} DEPENDS ${FUNCTIONALTEST_PREREQS}
USES_TERMINAL) USES_TERMINAL)
@ -66,6 +68,7 @@ if(BUSTED_PRG)
-D BUILD_DIR=${CMAKE_BINARY_DIR} -D BUILD_DIR=${CMAKE_BINARY_DIR}
-D TEST_TYPE=benchmark -D TEST_TYPE=benchmark
-D CIRRUS_CI=$ENV{CIRRUS_CI} -D CIRRUS_CI=$ENV{CIRRUS_CI}
-D CI_BUILD=${CI_BUILD}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${BENCHMARK_PREREQS} DEPENDS ${BENCHMARK_PREREQS}
USES_TERMINAL) USES_TERMINAL)
@ -85,6 +88,7 @@ if(BUSTED_LUA_PRG)
-D BUILD_DIR=${CMAKE_BINARY_DIR} -D BUILD_DIR=${CMAKE_BINARY_DIR}
-D TEST_TYPE=functional -D TEST_TYPE=functional
-D CIRRUS_CI=$ENV{CIRRUS_CI} -D CIRRUS_CI=$ENV{CIRRUS_CI}
-D CI_BUILD=${CI_BUILD}
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${FUNCTIONALTEST_PREREQS} DEPENDS ${FUNCTIONALTEST_PREREQS}
USES_TERMINAL) USES_TERMINAL)