From 3a69f33dfedbd1cab594fce3c9c0dfcfab774b5f Mon Sep 17 00:00:00 2001 From: "Aleksei (Faumaray) Selikhov" Date: Sun, 6 Dec 2026 02:49:24 +0300 Subject: [PATCH] ci: make downstream jobs self-sufficient The runner gives every job a different workspace directory, so the absolute paths baked into restored build artifacts (and the Ninja version installed by `requirements`) do not carry over. The Windows test/package phases now reconfigure and rebuild from the restored tree, and the Linux test job re-ensures Ninja >= 1.11 before running the CMake module-scanning suite. --- .gitea/scripts/windows-native.sh | 14 ++++++++++++-- .gitea/workflows/ci.yml | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitea/scripts/windows-native.sh b/.gitea/scripts/windows-native.sh index 46aa5e2..b3f18f9 100644 --- a/.gitea/scripts/windows-native.sh +++ b/.gitea/scripts/windows-native.sh @@ -43,20 +43,30 @@ if [ "${variant}" = "sanitizers" ]; then linker_flags="-fsanitize=address,undefined" fi -case "${phase}" in -build) +configure() { cmake -S . -B "${build}" -G Ninja \ -DCMAKE_BUILD_TYPE="${build_type}" \ -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_CXX_FLAGS="${cxx_flags}" \ -DCMAKE_EXE_LINKER_FLAGS="${linker_flags}" \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON +} + +case "${phase}" in +build) + configure cmake --build "${build}" --parallel 4 ;; test) + # The runner uses a different workspace directory per job, so the restored + # build's absolute paths are stale: reconfigure and rebuild incrementally. + configure + cmake --build "${build}" --parallel 4 ctest --test-dir "${build}" --output-on-failure --no-tests=error ;; package) + configure + cmake --build "${build}" --parallel 4 out="dist-windows-${variant}" label="${VBS_RELEASE_TAG:-}" if [ -z "${label}" ]; then diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e9f39ca..b436d08 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -157,6 +157,9 @@ jobs: UBSAN_OPTIONS: print_stacktrace=1 steps: - uses: actions/checkout@v4 + # Jobs are fresh containers: the upgrade done by `requirements` does not carry over. + - name: Ensure Ninja >= 1.11 (CMake module scanning in the suite) + run: bash .gitea/scripts/install-ninja.sh - name: Download the build uses: actions/download-artifact@v3 with: