Enhance GitHub Actions workflow for cross-platform executable testing
- Added separate steps for testing executable functionality on Windows, macOS, and Linux, improving clarity and organization. - Streamlined the executable path determination for Windows and implemented similar logic for macOS and Linux. - Enhanced error handling and output messages for better debugging during the testing process.
This commit is contained in:
101
.github/workflows/release.yml
vendored
101
.github/workflows/release.yml
vendored
@@ -448,8 +448,9 @@ jobs:
|
|||||||
Write-Host "✓ Visual Studio build validation PASSED" -ForegroundColor Green
|
Write-Host "✓ Visual Studio build validation PASSED" -ForegroundColor Green
|
||||||
Write-Host "========================================" -ForegroundColor Cyan
|
Write-Host "========================================" -ForegroundColor Cyan
|
||||||
|
|
||||||
# Test executable functionality (all platforms)
|
# Test executable functionality (Windows)
|
||||||
- name: Test executable functionality
|
- name: Test executable functionality (Windows)
|
||||||
|
if: runner.os == 'Windows'
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
@@ -462,14 +463,8 @@ jobs:
|
|||||||
Write-Host "build directory does not exist" -ForegroundColor Red
|
Write-Host "build directory does not exist" -ForegroundColor Red
|
||||||
}
|
}
|
||||||
|
|
||||||
# Determine executable path based on platform
|
# Determine executable path for Windows
|
||||||
if ("${{ runner.os }}" -eq "Windows") {
|
$exePath = "build\bin\${{ env.BUILD_TYPE }}\yaze.exe"
|
||||||
$exePath = "build\bin\${{ env.BUILD_TYPE }}\yaze.exe"
|
|
||||||
} elseif ("${{ runner.os }}" -eq "macOS") {
|
|
||||||
$exePath = "build/bin/yaze.app/Contents/MacOS/yaze"
|
|
||||||
} else {
|
|
||||||
$exePath = "build/bin/yaze"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Test-Path $exePath) {
|
if (Test-Path $exePath) {
|
||||||
Write-Host "✓ Executable found: $exePath" -ForegroundColor Green
|
Write-Host "✓ Executable found: $exePath" -ForegroundColor Green
|
||||||
@@ -494,10 +489,94 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Test executable functionality (macOS)
|
||||||
|
- name: Test executable functionality (macOS)
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Build directory contents:"
|
||||||
|
if [ -d "build" ]; then
|
||||||
|
find build -name "*.app" -o -name "yaze" | head -10
|
||||||
|
else
|
||||||
|
echo "build directory does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Determine executable path for macOS
|
||||||
|
exePath="build/bin/yaze.app/Contents/MacOS/yaze"
|
||||||
|
|
||||||
|
if [ -f "$exePath" ]; then
|
||||||
|
echo "✓ Executable found: $exePath"
|
||||||
|
|
||||||
|
# Test that it's not the test main
|
||||||
|
testResult=$($exePath --help 2>&1 || true)
|
||||||
|
exitCode=$?
|
||||||
|
|
||||||
|
if echo "$testResult" | grep -q "Google Test\|gtest"; then
|
||||||
|
echo "ERROR: Executable is running test main instead of app main!"
|
||||||
|
echo "Output: $testResult"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "✓ Executable runs correctly (exit code: $exitCode)"
|
||||||
|
|
||||||
|
# Display file info
|
||||||
|
fileSize=$(stat -f%z "$exePath")
|
||||||
|
fileSizeMB=$(echo "scale=2; $fileSize / 1024 / 1024" | bc -l)
|
||||||
|
echo "Executable size: ${fileSizeMB} MB"
|
||||||
|
else
|
||||||
|
echo "ERROR: Executable not found at: $exePath"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Test executable functionality (Linux)
|
||||||
|
- name: Test executable functionality (Linux)
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Build directory contents:"
|
||||||
|
if [ -d "build" ]; then
|
||||||
|
find build -type f -name "yaze" | head -10
|
||||||
|
else
|
||||||
|
echo "build directory does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Determine executable path for Linux
|
||||||
|
exePath="build/bin/yaze"
|
||||||
|
|
||||||
|
if [ -f "$exePath" ]; then
|
||||||
|
echo "✓ Executable found: $exePath"
|
||||||
|
|
||||||
|
# Test that it's not the test main
|
||||||
|
testResult=$($exePath --help 2>&1 || true)
|
||||||
|
exitCode=$?
|
||||||
|
|
||||||
|
if echo "$testResult" | grep -q "Google Test\|gtest"; then
|
||||||
|
echo "ERROR: Executable is running test main instead of app main!"
|
||||||
|
echo "Output: $testResult"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "✓ Executable runs correctly (exit code: $exitCode)"
|
||||||
|
|
||||||
|
# Display file info
|
||||||
|
fileSize=$(stat -c%s "$exePath")
|
||||||
|
fileSizeMB=$(echo "scale=2; $fileSize / 1024 / 1024" | bc -l)
|
||||||
|
echo "Executable size: ${fileSizeMB} MB"
|
||||||
|
else
|
||||||
|
echo "ERROR: Executable not found at: $exePath"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Package
|
# Package
|
||||||
- name: Package
|
- name: Package
|
||||||
|
shell: ${{ runner.os == 'Windows' && 'cmd' || 'bash' }}
|
||||||
run: ${{ matrix.package_cmd }}
|
run: ${{ matrix.package_cmd }}
|
||||||
shell: bash
|
|
||||||
|
|
||||||
# Create release with artifacts (will create release if it doesn't exist)
|
# Create release with artifacts (will create release if it doesn't exist)
|
||||||
- name: Upload to Release
|
- name: Upload to Release
|
||||||
|
|||||||
Reference in New Issue
Block a user