gitlab-ci: add jobs to test CMake with external dependencies on Linux

Test that CMake works without its bundled dependencies.
For some dependencies, test using the minimum supported version.
This commit is contained in:
Brad King 2022-08-18 10:05:19 -04:00
parent 6a05d107ca
commit b55152e7ad
12 changed files with 133 additions and 2 deletions

View File

@ -314,6 +314,33 @@ b:debian10-makefiles-inplace:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
b:debian10-extdeps:
extends:
- .debian10_extdeps
- .cmake_build_linux_standalone
- .linux_builder_tags
- .run_manually
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
b:debian10-aarch64-extdeps:
extends:
- .debian10_aarch64_extdeps
- .cmake_build_linux_standalone
- .linux_builder_tags_aarch64
- .run_manually
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
b:fedora36-extdeps:
extends:
- .fedora36_extdeps
- .cmake_build_linux_standalone
- .linux_builder_tags
- .run_manually
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
t:fedora36-ninja:
extends:
- .fedora36_ninja

View File

@ -0,0 +1 @@
include("${CMAKE_CURRENT_LIST_DIR}/configure_extdeps_common.cmake")

View File

@ -0,0 +1 @@
include("${CMAKE_CURRENT_LIST_DIR}/configure_extdeps_common.cmake")

View File

@ -0,0 +1,5 @@
set(CMAKE_USE_SYSTEM_LIBRARIES ON CACHE BOOL "")
set(CMAKE_SKIP_BOOTSTRAP_TEST ON CACHE BOOL "")
set(CMake_TEST_Qt6 OFF CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")

View File

@ -0,0 +1 @@
include("${CMAKE_CURRENT_LIST_DIR}/configure_extdeps_common.cmake")

View File

@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 3.8)
include("${CMAKE_CURRENT_LIST_DIR}/gitlab_ci.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/env_$ENV{CMAKE_CONFIGURATION}.cmake" OPTIONAL)
set(cmake_args
-C "${CMAKE_CURRENT_LIST_DIR}/configure_$ENV{CMAKE_CONFIGURATION}.cmake")
set(initial_cache "${CMAKE_CURRENT_LIST_DIR}/configure_$ENV{CMAKE_CONFIGURATION}.cmake")
set(cmake_args -C "${initial_cache}")
include(ProcessorCount)
ProcessorCount(nproc)
@ -25,6 +25,8 @@ ctest_update()
if("$ENV{CMAKE_CI_BOOTSTRAP}")
set(CTEST_CONFIGURE_COMMAND "\"${CTEST_SOURCE_DIRECTORY}/bootstrap\" --parallel=${nproc}")
elseif("$ENV{CMAKE_CONFIGURATION}" MATCHES "extdeps")
set(CTEST_CONFIGURE_COMMAND "/opt/extdeps/bin/cmake -C \"${initial_cache}\" -G \"${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"")
endif()
# Configure the project.

View File

@ -0,0 +1 @@
source .gitlab/ci/env_extdeps_common.sh

View File

@ -0,0 +1 @@
source .gitlab/ci/env_extdeps_common.sh

View File

@ -0,0 +1,5 @@
.gitlab/ci/extdeps-linux.sh
export CMAKE_PREFIX_PATH=/opt/extdeps
export PATH=/opt/extdeps/bin:$PATH
export LD_LIBRARY_PATH=/opt/extdeps/lib

View File

@ -0,0 +1 @@
source .gitlab/ci/env_extdeps_common.sh

62
.gitlab/ci/extdeps-linux.sh Executable file
View File

@ -0,0 +1,62 @@
#!/bin/sh
set -e
mkdir -p /opt/extdeps/src
cd /opt/extdeps/src
export PATH=/opt/extdeps/bin:$PATH
#----------------------------------------------------------------------------
# cmake
case "$(uname -s)-$(uname -m)" in
Linux-x86_64)
cmake_version="3.13.5"
cmake_sha256sum="e2fd0080a6f0fc1ec84647acdcd8e0b4019770f48d83509e6a5b0b6ea27e5864"
cmake_platform="Linux-x86_64"
;;
Linux-aarch64)
cmake_version="3.19.8"
cmake_sha256sum="807f5afb2a560e00af9640e496d5673afefc2888bf0ed076412884a5ebb547a1"
cmake_platform="Linux-aarch64"
;;
*)
echo "Unrecognized platform $(uname -s)-$(uname -m)"
exit 1
;;
esac
readonly shatool
readonly cmake_sha256sum
readonly cmake_platform
readonly cmake_filename="cmake-$cmake_version-$cmake_platform"
readonly cmake_tarball="$cmake_filename.tar.gz"
echo "$cmake_sha256sum $cmake_tarball" > cmake.sha256sum
curl -OL "https://github.com/Kitware/CMake/releases/download/v$cmake_version/$cmake_tarball"
sha256sum --check cmake.sha256sum
tar xzf "$cmake_tarball" -C /opt/extdeps --strip-components=1
rm -f "$cmake_tarball" cmake.sha256sum
#----------------------------------------------------------------------------
# libuv
curl -L -o libuv-1.28.0.tar.gz https://github.com/libuv/libuv/archive/refs/tags/v1.28.0.tar.gz
tar xzf libuv-1.28.0.tar.gz
cmake -S libuv-1.28.0 -B libuv-1.28.0-build \
-DCMAKE_INSTALL_PREFIX=/opt/extdeps
cmake --build libuv-1.28.0-build --target install
rm -rf libuv-1.28.0*
#----------------------------------------------------------------------------
# jsoncpp
curl -L -o jsoncpp-1.6.0.tar.gz https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/1.6.0.tar.gz
tar xzf jsoncpp-1.6.0.tar.gz
cmake -S jsoncpp-1.6.0 -B jsoncpp-1.6.0-build \
-DCMAKE_BUILD_TYPE=Release \
-DJSONCPP_LIB_BUILD_STATIC=ON \
-DJSONCPP_LIB_BUILD_SHARED=ON \
-DCMAKE_INSTALL_PREFIX=/opt/extdeps
cmake --build jsoncpp-1.6.0-build --target install
rm -rf jsoncpp-1.6.0*

View File

@ -137,6 +137,30 @@
CMAKE_CI_NO_INSTALL: 1
CTEST_NO_WARNINGS_ALLOWED: 1
.debian10_extdeps:
extends: .debian10
variables:
CMAKE_CONFIGURATION: debian10_extdeps
CMAKE_CI_BUILD_TYPE: Release
CTEST_NO_WARNINGS_ALLOWED: 1
.debian10_aarch64_extdeps:
extends: .debian10_aarch64
variables:
CMAKE_CONFIGURATION: debian10_aarch64_extdeps
CMAKE_CI_BUILD_TYPE: Release
CTEST_NO_WARNINGS_ALLOWED: 1
.fedora36_extdeps:
extends: .fedora36
variables:
CMAKE_CONFIGURATION: fedora36_extdeps
CMAKE_CI_BUILD_TYPE: Release
CTEST_NO_WARNINGS_ALLOWED: 1
.fedora36_ninja:
extends: .fedora36