From: Pasukhin Dmitry Date: Sun, 30 Nov 2025 12:11:35 +0000 (+0000) Subject: Testing - Update workflow dependencies and debug GTest (#866) X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=2c48978cdaee1e6215f13e800d841acb2b6e71ef;p=occt.git Testing - Update workflow dependencies and debug GTest (#866) - Establishes explicit job dependencies to prevent redundant workflow runs - Adds GTest execution for macOS with Clang (No PCH) in Debug mode - Creates a dependency chain where macOS Clang (No PCH) builds depend on standard macOS builds --- diff --git a/.github/actions/build-occt/action.yml b/.github/actions/build-occt/action.yml index bdd11d9085..7cea21a2f3 100644 --- a/.github/actions/build-occt/action.yml +++ b/.github/actions/build-occt/action.yml @@ -55,6 +55,7 @@ runs: with: artifact-name: ${{ inputs.artifact-name }}-cache build-directory: build + include-debug: ${{ inputs.cmake-build-type == 'Debug' && 'true' || 'false' }} - name: Build OCCT (Windows) if: ${{ inputs.platform == 'windows' }} diff --git a/.github/actions/download-vcpkg-cache/action.yml b/.github/actions/download-vcpkg-cache/action.yml index a752fc0a59..d406c9931f 100644 --- a/.github/actions/download-vcpkg-cache/action.yml +++ b/.github/actions/download-vcpkg-cache/action.yml @@ -66,14 +66,19 @@ runs: run: | vcpkg_lib="${{ inputs.build-directory }}/vcpkg_installed/arm64-osx-dynamic/lib" vcpkg_manual="${{ inputs.build-directory }}/vcpkg_installed/arm64-osx-dynamic/lib/manual-link" - + vcpkg_debug_lib="${{ inputs.build-directory }}/vcpkg_installed/arm64-osx-dynamic/debug/lib" + # Copy manual-link libraries to main lib directory for runtime access if [ -d "$vcpkg_manual" ]; then echo "Copying manual-link libraries to main lib directory" cp -f "$vcpkg_manual"/* "$vcpkg_lib/" 2>/dev/null || true fi - - # Set library search paths - echo "DYLD_FALLBACK_LIBRARY_PATH=$vcpkg_lib:$vcpkg_manual:$DYLD_FALLBACK_LIBRARY_PATH" >> $GITHUB_ENV - echo "DYLD_LIBRARY_PATH=$vcpkg_lib:$vcpkg_manual:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV + + # Set library search paths (include debug paths if they exist) + LIB_PATHS="$vcpkg_lib:$vcpkg_manual" + if [ -d "$vcpkg_debug_lib" ]; then + LIB_PATHS="$vcpkg_debug_lib:$LIB_PATHS" + fi + echo "DYLD_FALLBACK_LIBRARY_PATH=$LIB_PATHS:$DYLD_FALLBACK_LIBRARY_PATH" >> $GITHUB_ENV + echo "DYLD_LIBRARY_PATH=$LIB_PATHS:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV shell: bash diff --git a/.github/actions/run-gtest/action.yml b/.github/actions/run-gtest/action.yml index 44aab0ead6..959ffe7aac 100644 --- a/.github/actions/run-gtest/action.yml +++ b/.github/actions/run-gtest/action.yml @@ -63,6 +63,45 @@ runs: type gtest_output.log exit /b 0 + - name: Set library paths on macOS + if: inputs.platform == 'macos' + shell: bash + run: | + convert_to_absolute() { + local result="" + IFS=':' read -ra PATHS <<< "$1" + for p in "${PATHS[@]}"; do + [ -n "$p" ] && [ "${p:0:1}" != "/" ] && p="${GITHUB_WORKSPACE}/$p" + result="${result}${result:+:}$p" + done + echo "$result" + } + # OCCT libraries are in install/lib + OCCT_LIB="${GITHUB_WORKSPACE}/install/lib" + DYLD_PATHS="$OCCT_LIB" + [ -n "$DYLD_LIBRARY_PATH" ] && DYLD_PATHS="$DYLD_PATHS:$(convert_to_absolute "$DYLD_LIBRARY_PATH")" + echo "DYLD_LIBRARY_PATH=$DYLD_PATHS" >> $GITHUB_ENV + echo "DYLD_FALLBACK_LIBRARY_PATH=$DYLD_PATHS" >> $GITHUB_ENV + + - name: Set library paths on Linux + if: inputs.platform == 'linux' + shell: bash + run: | + convert_to_absolute() { + local result="" + IFS=':' read -ra PATHS <<< "$1" + for p in "${PATHS[@]}"; do + [ -n "$p" ] && [ "${p:0:1}" != "/" ] && p="${GITHUB_WORKSPACE}/$p" + result="${result}${result:+:}$p" + done + echo "$result" + } + # OCCT libraries are in install/lib + OCCT_LIB="${GITHUB_WORKSPACE}/install/lib" + LD_PATHS="$OCCT_LIB" + [ -n "$LD_LIBRARY_PATH" ] && LD_PATHS="$LD_PATHS:$(convert_to_absolute "$LD_LIBRARY_PATH")" + echo "LD_LIBRARY_PATH=$LD_PATHS" >> $GITHUB_ENV + - name: Run OpenCascadeGTest on Unix platforms if: inputs.platform != 'windows' id: run-gtest-unix @@ -73,8 +112,16 @@ runs: run: | cd install/bin source env.sh - ./OpenCascadeGTest --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1 || true + EXIT_CODE=0 + ./OpenCascadeGTest --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1 || EXIT_CODE=$? cat gtest_output.log + # Check for crashes (signals like SIGABRT=134, SIGSEGV=139, etc.) + if [ $EXIT_CODE -gt 128 ]; then + echo "::error::GTest crashed with signal $((EXIT_CODE - 128))" + echo "gtest_crashed=true" >> $GITHUB_OUTPUT + else + echo "gtest_crashed=false" >> $GITHUB_OUTPUT + fi - name: Upload GTest results uses: actions/upload-artifact@v4.6.2 @@ -120,13 +167,19 @@ runs: run: | if [ "${{ inputs.platform }}" == "windows" ]; then echo "has_failures=${{ steps.check-failures-windows.outputs.has_failures }}" >> $GITHUB_OUTPUT + echo "crashed=false" >> $GITHUB_OUTPUT else echo "has_failures=${{ steps.check-failures-unix.outputs.has_failures }}" >> $GITHUB_OUTPUT + echo "crashed=${{ steps.run-gtest-unix.outputs.gtest_crashed }}" >> $GITHUB_OUTPUT fi - - name: Fail job if tests failed - if: steps.check-failures.outputs.has_failures == 'true' + - name: Fail job if tests failed or crashed + if: steps.check-failures.outputs.has_failures == 'true' || steps.check-failures.outputs.crashed == 'true' shell: bash run: | - echo "::error::GTest failures detected" + if [ "${{ steps.check-failures.outputs.crashed }}" == "true" ]; then + echo "::error::GTest crashed during execution" + else + echo "::error::GTest failures detected" + fi exit 1 diff --git a/.github/actions/upload-vcpkg-cache/action.yml b/.github/actions/upload-vcpkg-cache/action.yml index e4b43c08ef..1794ac1ba6 100644 --- a/.github/actions/upload-vcpkg-cache/action.yml +++ b/.github/actions/upload-vcpkg-cache/action.yml @@ -9,6 +9,10 @@ inputs: description: 'Build directory containing vcpkg_installed' required: false default: 'build' + include-debug: + description: 'Include debug libraries in the cache' + required: false + default: 'false' runs: using: "composite" @@ -17,8 +21,12 @@ runs: - name: Create vcpkg tar archive run: | cd ${{ inputs.build-directory }} + EXCLUDE_DEBUG="" + if [ "${{ inputs.include-debug }}" != "true" ]; then + EXCLUDE_DEBUG="--exclude=vcpkg_installed/*/debug" + fi tar -czf vcpkg-dependencies.tar.gz \ - --exclude='vcpkg_installed/*/debug' \ + $EXCLUDE_DEBUG \ --exclude='vcpkg_installed/**/*.pdb' \ --exclude='vcpkg_installed/**/*.lib' \ ./vcpkg_installed/ diff --git a/.github/workflows/build-and-test-multiplatform.yml b/.github/workflows/build-and-test-multiplatform.yml index 667d255764..56d61661cc 100644 --- a/.github/workflows/build-and-test-multiplatform.yml +++ b/.github/workflows/build-and-test-multiplatform.yml @@ -53,6 +53,23 @@ jobs: documentation: name: Build Documentation runs-on: windows-2025 + if: github.ref == 'refs/heads/master' + needs: + - clang-format + - ascii-check + - build-inspector-windows + - build-inspector-linux + - build-csharp-windows + - build-mfc-windows + - build-qt-windows + - build-qt-linux + - retest-windows-x64 + - retest-macos-x64 + - retest-linux-clang-x64 + - run-gtest-windows-x64 + - run-gtest-macos-x64 + - run-gtest-linux-clang-x64 + - run-gtest-macos-clang-no-pch steps: - name: Checkout repository @@ -111,6 +128,7 @@ jobs: prepare-and-build-macos-clang-no-pch: name: Prepare and Build on macOS with Clang (No PCH) + needs: prepare-and-build-macos-x64 runs-on: macos-15 steps: @@ -378,6 +396,23 @@ jobs: install-artifact-name: install-linux-clang-x64 artifact-suffix: x64 + run-gtest-macos-clang-no-pch: + name: Run GTest on macOS with Clang (No PCH, Debug) + needs: prepare-and-build-macos-clang-no-pch + runs-on: macos-15 + + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + + - name: Run GTests + uses: ./.github/actions/run-gtest + with: + platform: macos + compiler: clang + install-artifact-name: install-macos-clang-no-pch + artifact-suffix: no-pch + test-summary: name: 'Summarize Test Results' runs-on: ubuntu-24.04