mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-10 09:30:48 +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:
|
with:
|
||||||
artifact-name: ${{ inputs.artifact-name }}-cache
|
artifact-name: ${{ inputs.artifact-name }}-cache
|
||||||
build-directory: build
|
build-directory: build
|
||||||
|
include-debug: ${{ inputs.cmake-build-type == 'Debug' && 'true' || 'false' }}
|
||||||
|
|
||||||
- name: Build OCCT (Windows)
|
- name: Build OCCT (Windows)
|
||||||
if: ${{ inputs.platform == 'windows' }}
|
if: ${{ inputs.platform == 'windows' }}
|
||||||
|
|||||||
11
.github/actions/download-vcpkg-cache/action.yml
vendored
11
.github/actions/download-vcpkg-cache/action.yml
vendored
@@ -66,6 +66,7 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
vcpkg_lib="${{ inputs.build-directory }}/vcpkg_installed/arm64-osx-dynamic/lib"
|
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_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
|
# Copy manual-link libraries to main lib directory for runtime access
|
||||||
if [ -d "$vcpkg_manual" ]; then
|
if [ -d "$vcpkg_manual" ]; then
|
||||||
@@ -73,7 +74,11 @@ runs:
|
|||||||
cp -f "$vcpkg_manual"/* "$vcpkg_lib/" 2>/dev/null || true
|
cp -f "$vcpkg_manual"/* "$vcpkg_lib/" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set library search paths
|
# Set library search paths (include debug paths if they exist)
|
||||||
echo "DYLD_FALLBACK_LIBRARY_PATH=$vcpkg_lib:$vcpkg_manual:$DYLD_FALLBACK_LIBRARY_PATH" >> $GITHUB_ENV
|
LIB_PATHS="$vcpkg_lib:$vcpkg_manual"
|
||||||
echo "DYLD_LIBRARY_PATH=$vcpkg_lib:$vcpkg_manual:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
|
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
|
shell: bash
|
||||||
|
|||||||
59
.github/actions/run-gtest/action.yml
vendored
59
.github/actions/run-gtest/action.yml
vendored
@@ -63,6 +63,45 @@ runs:
|
|||||||
type gtest_output.log
|
type gtest_output.log
|
||||||
exit /b 0
|
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
|
- name: Run OpenCascadeGTest on Unix platforms
|
||||||
if: inputs.platform != 'windows'
|
if: inputs.platform != 'windows'
|
||||||
id: run-gtest-unix
|
id: run-gtest-unix
|
||||||
@@ -73,8 +112,16 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
cd install/bin
|
cd install/bin
|
||||||
source env.sh
|
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
|
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
|
- name: Upload GTest results
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v4.6.2
|
||||||
@@ -120,13 +167,19 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
if [ "${{ inputs.platform }}" == "windows" ]; then
|
if [ "${{ inputs.platform }}" == "windows" ]; then
|
||||||
echo "has_failures=${{ steps.check-failures-windows.outputs.has_failures }}" >> $GITHUB_OUTPUT
|
echo "has_failures=${{ steps.check-failures-windows.outputs.has_failures }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "crashed=false" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "has_failures=${{ steps.check-failures-unix.outputs.has_failures }}" >> $GITHUB_OUTPUT
|
echo "has_failures=${{ steps.check-failures-unix.outputs.has_failures }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "crashed=${{ steps.run-gtest-unix.outputs.gtest_crashed }}" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Fail job if tests failed
|
- name: Fail job if tests failed or crashed
|
||||||
if: steps.check-failures.outputs.has_failures == 'true'
|
if: steps.check-failures.outputs.has_failures == 'true' || steps.check-failures.outputs.crashed == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
if [ "${{ steps.check-failures.outputs.crashed }}" == "true" ]; then
|
||||||
|
echo "::error::GTest crashed during execution"
|
||||||
|
else
|
||||||
echo "::error::GTest failures detected"
|
echo "::error::GTest failures detected"
|
||||||
|
fi
|
||||||
exit 1
|
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'
|
description: 'Build directory containing vcpkg_installed'
|
||||||
required: false
|
required: false
|
||||||
default: 'build'
|
default: 'build'
|
||||||
|
include-debug:
|
||||||
|
description: 'Include debug libraries in the cache'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
@@ -17,8 +21,12 @@ runs:
|
|||||||
- name: Create vcpkg tar archive
|
- name: Create vcpkg tar archive
|
||||||
run: |
|
run: |
|
||||||
cd ${{ inputs.build-directory }}
|
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 \
|
tar -czf vcpkg-dependencies.tar.gz \
|
||||||
--exclude='vcpkg_installed/*/debug' \
|
$EXCLUDE_DEBUG \
|
||||||
--exclude='vcpkg_installed/**/*.pdb' \
|
--exclude='vcpkg_installed/**/*.pdb' \
|
||||||
--exclude='vcpkg_installed/**/*.lib' \
|
--exclude='vcpkg_installed/**/*.lib' \
|
||||||
./vcpkg_installed/
|
./vcpkg_installed/
|
||||||
|
|||||||
@@ -53,6 +53,23 @@ jobs:
|
|||||||
documentation:
|
documentation:
|
||||||
name: Build Documentation
|
name: Build Documentation
|
||||||
runs-on: windows-2025
|
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:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -111,6 +128,7 @@ jobs:
|
|||||||
|
|
||||||
prepare-and-build-macos-clang-no-pch:
|
prepare-and-build-macos-clang-no-pch:
|
||||||
name: Prepare and Build on macOS with Clang (No PCH)
|
name: Prepare and Build on macOS with Clang (No PCH)
|
||||||
|
needs: prepare-and-build-macos-x64
|
||||||
runs-on: macos-15
|
runs-on: macos-15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -378,6 +396,23 @@ jobs:
|
|||||||
install-artifact-name: install-linux-clang-x64
|
install-artifact-name: install-linux-clang-x64
|
||||||
artifact-suffix: 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:
|
test-summary:
|
||||||
name: 'Summarize Test Results'
|
name: 'Summarize Test Results'
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|||||||
Reference in New Issue
Block a user