]> OCCT Git - occt.git/commitdiff
Testing - Update workflow dependencies and debug GTest (#866)
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Sun, 30 Nov 2025 12:11:35 +0000 (12:11 +0000)
committerGitHub <noreply@github.com>
Sun, 30 Nov 2025 12:11:35 +0000 (12:11 +0000)
- 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

.github/actions/build-occt/action.yml
.github/actions/download-vcpkg-cache/action.yml
.github/actions/run-gtest/action.yml
.github/actions/upload-vcpkg-cache/action.yml
.github/workflows/build-and-test-multiplatform.yml

index bdd11d90855f6cb882814173aa31dcc4a51cdfb7..7cea21a2f387556de83a2edc97c2cf29dd778526 100644 (file)
@@ -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' }}
index a752fc0a59fa5989c820bc70a53a0118c263bfcb..d406c9931f75a3eeb8268cf1f724ae1ce9c64f9e 100644 (file)
@@ -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
index 44aab0ead694947d98f642de7cd4c12edf730d48..959ffe7aac0b58e28e5eadaf2ca03d76020dcd06 100644 (file)
@@ -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
index e4b43c08ef0ccabfba968f0ef2c23a2492740cd0..1794ac1ba6f1e4d01c775eb14202870e39d6985e 100644 (file)
@@ -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/
index 667d25576497798d4e65cad34b6f2712cc62a40e..56d61661cc286fffb0c2e3f49a4ed7488f89b0eb 100644 (file)
@@ -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