Revert "gate ccache correctly"

This reverts commit 0af93629de.
This commit is contained in:
tooomm 2026-08-29 11:47:55 +02:00
parent 0af93629de
commit 2ff26aa3b1

View file

@ -124,10 +124,6 @@ set -e
# Setup # Setup
./servatrice/check_schema_version.sh ./servatrice/check_schema_version.sh
if [[ ! $USE_CCACHE ]]; then
USE_CCACHE=0
fi
if [[ ! $BUILDTYPE ]]; then if [[ ! $BUILDTYPE ]]; then
BUILDTYPE=Release BUILDTYPE=Release
fi fi
@ -140,7 +136,7 @@ cd "$BUILD_DIR"
# Set minimum CMake Version # Set minimum CMake Version
export CMAKE_POLICY_VERSION_MINIMUM=3.10 export CMAKE_POLICY_VERSION_MINIMUM=3.10
# Add CMake flags # Add cmake flags
flags=("-DCMAKE_BUILD_TYPE=$BUILDTYPE") flags=("-DCMAKE_BUILD_TYPE=$BUILDTYPE")
if [[ $MAKE_SERVER ]]; then if [[ $MAKE_SERVER ]]; then
flags+=("-DWITH_SERVER=1") flags+=("-DWITH_SERVER=1")
@ -151,14 +147,12 @@ fi
if [[ $MAKE_TEST ]]; then if [[ $MAKE_TEST ]]; then
flags+=("-DTEST=1") flags+=("-DTEST=1")
fi fi
if [[ $USE_CCACHE == "1" ]]; then if [[ $USE_CCACHE ]]; then
flags+=("-DUSE_CCACHE=1") flags+=("-DUSE_CCACHE=1")
if [[ $CCACHE_SIZE ]]; then if [[ $CCACHE_SIZE ]]; then
# This setting persists after running the script # note, this setting persists after running the script
ccache --max-size "$CCACHE_SIZE" ccache --max-size "$CCACHE_SIZE"
fi fi
else
flags+=("-DUSE_CCACHE=0")
fi fi
if [[ $PACKAGE_TYPE ]]; then if [[ $PACKAGE_TYPE ]]; then
flags+=("-DCPACK_GENERATOR=$PACKAGE_TYPE") flags+=("-DCPACK_GENERATOR=$PACKAGE_TYPE")
@ -168,7 +162,7 @@ if [[ $USE_VCPKG ]]; then
flags+=("-DVCPKG_INSTALL_OPTIONS=--x-abi-tools-use-exact-versions") flags+=("-DVCPKG_INSTALL_OPTIONS=--x-abi-tools-use-exact-versions")
fi fi
# Add CMake --build flags # Add cmake --build flags
buildflags=(--config "$BUILDTYPE") buildflags=(--config "$BUILDTYPE")
function ccachestatsverbose() { function ccachestatsverbose() {
@ -181,7 +175,7 @@ function ccachestatsverbose() {
fi fi
} }
# Prepare compilation # Compile
if [[ $RUNNER_OS == macOS ]]; then if [[ $RUNNER_OS == macOS ]]; then
# QTDIR is needed for macOS since we actually only use the cached thin Qt binaries instead of the install-qt-action, # QTDIR is needed for macOS since we actually only use the cached thin Qt binaries instead of the install-qt-action,
# which sets a few environment variables # which sets a few environment variables
@ -264,26 +258,24 @@ elif [[ $RUNNER_OS == Windows ]]; then
buildflags+=(-- -p:UseMultiToolTask=true -p:EnableClServerMode=true) buildflags+=(-- -p:UseMultiToolTask=true -p:EnableClServerMode=true)
fi fi
if [[ $USE_CCACHE == "1" ]]; then if [[ $USE_CCACHE ]]; then
echo "::group::Show ccache stats" echo "::group::Show ccache stats"
ccachestatsverbose ccachestatsverbose
echo "::endgroup::" echo "::endgroup::"
fi fi
# Configure CMake echo "::group::Configure cmake"
echo "::group::Configure CMake"
cmake --version cmake --version
echo "Running CMake with these flags: ${flags[*]}" echo "Running cmake with flags: ${flags[*]}"
cmake .. "${flags[@]}" cmake .. "${flags[@]}"
echo "::endgroup::" echo "::endgroup::"
# Build
echo "::group::Build project" echo "::group::Build project"
echo "Running CMake with these build flags: ${buildflags[*]}" echo "Running cmake --build with flags: ${buildflags[*]}"
cmake --build . "${buildflags[@]}" cmake --build . "${buildflags[@]}"
echo "::endgroup::" echo "::endgroup::"
if [[ $USE_CCACHE == "1" ]]; then if [[ $USE_CCACHE ]]; then
if [[ $CCACHE_EVICTION_AGE ]]; then if [[ $CCACHE_EVICTION_AGE ]]; then
echo "::group::evict ccache files older than $CCACHE_EVICTION_AGE" echo "::group::evict ccache files older than $CCACHE_EVICTION_AGE"
ccache --evict-older-than "$CCACHE_EVICTION_AGE" ccache --evict-older-than "$CCACHE_EVICTION_AGE"
@ -309,21 +301,18 @@ if [[ $RUNNER_OS == macOS ]]; then
echo "::endgroup::" echo "::endgroup::"
fi fi
# Test
if [[ $MAKE_TEST ]]; then if [[ $MAKE_TEST ]]; then
echo "::group::Run tests" echo "::group::Run tests"
ctest -C "$BUILDTYPE" --output-on-failure ctest -C "$BUILDTYPE" --output-on-failure
echo "::endgroup::" echo "::endgroup::"
fi fi
# Install
if [[ $MAKE_INSTALL ]]; then if [[ $MAKE_INSTALL ]]; then
echo "::group::Install" echo "::group::Install"
cmake --build . --target install --config "$BUILDTYPE" cmake --build . --target install --config "$BUILDTYPE"
echo "::endgroup::" echo "::endgroup::"
fi fi
# Package
if [[ $MAKE_PACKAGE ]]; then if [[ $MAKE_PACKAGE ]]; then
echo "::group::Create package" echo "::group::Create package"
cmake --build . --target package --config "$BUILDTYPE" cmake --build . --target package --config "$BUILDTYPE"