mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-10 01:20:50 +08:00
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
This commit is contained in:
1
.github/actions/build-occt/action.yml
vendored
1
.github/actions/build-occt/action.yml
vendored
@@ -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' }}
|
||||
|
||||
15
.github/actions/download-vcpkg-cache/action.yml
vendored
15
.github/actions/download-vcpkg-cache/action.yml
vendored
@@ -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
|
||||
|
||||
61
.github/actions/run-gtest/action.yml
vendored
61
.github/actions/run-gtest/action.yml
vendored
@@ -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
|
||||
|
||||
10
.github/actions/upload-vcpkg-cache/action.yml
vendored
10
.github/actions/upload-vcpkg-cache/action.yml
vendored
@@ -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/
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user