ci: add test binaries workflow #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Binaries | |
| on: | |
| pull_request: | |
| branches: | |
| - dev | |
| paths: | |
| - '.github/workflows/test-binaries.yml' | |
| - '.github/workflows/menlo-build.yml' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to test' | |
| required: false | |
| default: 'b5857' | |
| env: | |
| TEST_VERSION: 'b5857' | |
| jobs: | |
| test-binaries: | |
| runs-on: ${{ matrix.runs-on }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: "linux" | |
| name: "noavx-x64" | |
| runs-on: "ubuntu-20.04" | |
| binary-name: "llama-server" | |
| artifact-name: "llama-linux-noavx-x64" | |
| - os: "linux" | |
| name: "avx-x64" | |
| runs-on: "ubuntu-20.04" | |
| binary-name: "llama-server" | |
| artifact-name: "llama-linux-avx-x64" | |
| - os: "linux" | |
| name: "avx512-x64" | |
| runs-on: "ubuntu-20.04" | |
| binary-name: "llama-server" | |
| artifact-name: "llama-linux-avx512-x64" | |
| - os: "linux" | |
| name: "vulkan-x64" | |
| runs-on: "ubuntu-22.04" | |
| binary-name: "llama-server" | |
| artifact-name: "llama-linux-vulkan-x64" | |
| - os: "macos" | |
| name: "x64" | |
| runs-on: "macos-selfhosted-12" | |
| binary-name: "llama-server" | |
| artifact-name: "llama-macos-x64" | |
| - os: "macos" | |
| name: "arm64" | |
| runs-on: "macos-selfhosted-12-arm64" | |
| binary-name: "llama-server" | |
| artifact-name: "llama-macos-arm64" | |
| - os: "win" | |
| name: "noavx-x64" | |
| runs-on: "windows-latest" | |
| binary-name: "llama-server.exe" | |
| artifact-name: "llama-win-noavx-x64" | |
| - os: "win" | |
| name: "avx-x64" | |
| runs-on: "windows-latest" | |
| binary-name: "llama-server.exe" | |
| artifact-name: "llama-win-avx-x64" | |
| - os: "win" | |
| name: "avx2-x64" | |
| runs-on: "windows-latest" | |
| binary-name: "llama-server.exe" | |
| artifact-name: "llama-win-avx2-x64" | |
| - os: "win" | |
| name: "avx512-x64" | |
| runs-on: "windows-latest" | |
| binary-name: "llama-server.exe" | |
| artifact-name: "llama-win-avx512-x64" | |
| - os: "win" | |
| name: "vulkan-x64" | |
| runs-on: "windows-latest" | |
| binary-name: "llama-server.exe" | |
| artifact-name: "llama-win-vulkan-x64" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Install jq (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| if ! command -v jq &> /dev/null; then | |
| echo "Installing jq..." | |
| brew install jq | |
| else | |
| echo "jq already installed" | |
| fi | |
| - name: Show testing version | |
| run: | | |
| echo "Testing hardcoded version: ${{ env.TEST_VERSION }}" | |
| echo "This will download binaries from release: ${{ env.TEST_VERSION }}" | |
| - name: Download release binaries (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Download the specific release binary for this matrix combination | |
| RELEASE_TAG="${{ env.TEST_VERSION }}" | |
| ASSET_NAME="llama-${RELEASE_TAG}-bin-${{ matrix.os }}-${{ matrix.name }}.tar.gz" | |
| echo "Downloading asset: $ASSET_NAME" | |
| # Get download URL for the asset | |
| DOWNLOAD_URL=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ | |
| "https://api.github.com/repos/${{ github.repository }}/releases/tags/$RELEASE_TAG" | \ | |
| jq -r --arg asset_name "$ASSET_NAME" '.assets[] | select(.name == $asset_name) | .browser_download_url') | |
| if [ "$DOWNLOAD_URL" = "null" ] || [ -z "$DOWNLOAD_URL" ]; then | |
| echo "Asset $ASSET_NAME not found in release $RELEASE_TAG" | |
| echo "Available assets:" | |
| curl -s -H "Authorization: token $GITHUB_TOKEN" \ | |
| "https://api.github.com/repos/${{ github.repository }}/releases/tags/$RELEASE_TAG" | \ | |
| jq -r '.assets[].name' | |
| exit 1 | |
| fi | |
| # Download the binary | |
| mkdir -p artifacts | |
| curl -L -H "Authorization: token $GITHUB_TOKEN" \ | |
| -o "artifacts/binary.tar.gz" \ | |
| "$DOWNLOAD_URL" | |
| echo "Downloaded binary successfully" | |
| ls -la artifacts/ | |
| - name: Download release binaries (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Download the specific release binary for this matrix combination | |
| $releaseTag = "${{ env.TEST_VERSION }}" | |
| $assetName = "llama-$releaseTag-bin-${{ matrix.os }}-${{ matrix.name }}.tar.gz" | |
| Write-Host "Downloading asset: $assetName" | |
| # Get release info | |
| $headers = @{ | |
| 'Authorization' = "token $env:GITHUB_TOKEN" | |
| 'Accept' = 'application/vnd.github.v3+json' | |
| } | |
| $releaseUrl = "https://api.github.com/repos/${{ github.repository }}/releases/tags/$releaseTag" | |
| $release = Invoke-RestMethod -Uri $releaseUrl -Headers $headers | |
| # Find the asset | |
| $asset = $release.assets | Where-Object { $_.name -eq $assetName } | |
| if (-not $asset) { | |
| Write-Host "Asset $assetName not found in release $releaseTag" | |
| Write-Host "Available assets:" | |
| $release.assets | ForEach-Object { Write-Host $_.name } | |
| exit 1 | |
| } | |
| # Download the binary | |
| New-Item -ItemType Directory -Force -Path "artifacts" | |
| Invoke-WebRequest -Uri $asset.browser_download_url -OutFile "artifacts\binary.tar.gz" -Headers $headers | |
| Write-Host "Downloaded binary successfully" | |
| Get-ChildItem -Path "artifacts" | |
| - name: Extract artifacts (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| run: | | |
| echo "Extracting binary for ${{ matrix.artifact-name }}..." | |
| cd artifacts | |
| tar -xzf binary.tar.gz | |
| cd .. | |
| # List what we extracted | |
| ls -la ./ | |
| find . -name "*llama*" -type d | head -5 | |
| # Find and create standardized structure | |
| if [ -d "llama" ]; then | |
| echo "Found llama directory" | |
| else | |
| # Move extracted directory to llama/ | |
| find . -maxdepth 2 -type d -name "*llama*" -exec mv {} llama \; || true | |
| # Alternative: if extraction creates different structure | |
| if [ ! -d "llama" ]; then | |
| mkdir -p llama | |
| find artifacts/ -name "*.tar.gz" -exec tar -xzf {} -C llama \; | |
| fi | |
| fi | |
| # Verify binary location | |
| find . -name "${{ matrix.binary-name }}" -type f | head -5 | |
| - name: Extract artifacts (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| Write-Host "Extracting binary for ${{ matrix.artifact-name }}..." | |
| # Extract using tar | |
| Set-Location artifacts | |
| tar -xzf binary.tar.gz | |
| Set-Location .. | |
| # List what we have (showing directory structure) | |
| Write-Host "Directory structure after extraction:" | |
| Get-ChildItem -Recurse | Where-Object {$_.Name -like "*llama*" -or $_.Name -like "*.exe"} | Select-Object -First 10 | |
| # Find the binary with better error handling | |
| $binaryPath = $null | |
| try { | |
| $binaryPath = Get-ChildItem -Recurse -Filter "${{ matrix.binary-name }}" | Select-Object -First 1 -ExpandProperty Name | |
| if ($binaryPath) { | |
| $fullBinaryPath = Get-ChildItem -Recurse -Filter "${{ matrix.binary-name }}" | Select-Object -First 1 -ExpandProperty FullName | |
| Write-Host "Found binary at: $fullBinaryPath" | |
| } | |
| } catch { | |
| Write-Host "Error searching for binary: $($_.Exception.Message)" | |
| } | |
| if (-not $binaryPath) { | |
| Write-Host "Binary ${{ matrix.binary-name }} not found, listing all .exe files:" | |
| Get-ChildItem -Recurse -Filter "*.exe" | ForEach-Object { Write-Host $_.FullName } | |
| } | |
| - name: Make binary executable (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| run: | | |
| # Find the actual binary location | |
| BINARY_PATH=$(find . -name "${{ matrix.binary-name }}" -type f | head -1) | |
| if [ -n "$BINARY_PATH" ]; then | |
| chmod +x "$BINARY_PATH" | |
| echo "Made executable: $BINARY_PATH" | |
| # Create symlink for consistent path | |
| mkdir -p llama/build/bin | |
| ln -sf "$(realpath $BINARY_PATH)" llama/build/bin/${{ matrix.binary-name }} | |
| else | |
| echo "Binary not found!" | |
| echo "Available files:" | |
| find . -type f -name "*server*" | head -10 | |
| exit 1 | |
| fi | |
| - name: Setup binary path (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| # Find the actual binary using -Filter instead of -Name | |
| $binaryFile = Get-ChildItem -Recurse -Filter "${{ matrix.binary-name }}" | Select-Object -First 1 | |
| if ($binaryFile) { | |
| Write-Host "Found binary at: $($binaryFile.FullName)" | |
| # Create standardized directory structure | |
| New-Item -ItemType Directory -Force -Path "llama\build\bin" | |
| Copy-Item $binaryFile.FullName "llama\build\bin\${{ matrix.binary-name }}" | |
| Write-Host "Binary copied to: llama\build\bin\${{ matrix.binary-name }}" | |
| # Verify the copy worked | |
| if (Test-Path "llama\build\bin\${{ matrix.binary-name }}") { | |
| Write-Host "Binary successfully copied and ready for testing" | |
| } else { | |
| Write-Host "Error: Binary copy failed" | |
| exit 1 | |
| } | |
| } else { | |
| Write-Host "Binary ${{ matrix.binary-name }} not found!" | |
| Write-Host "Searching for any server executables:" | |
| Get-ChildItem -Recurse -Filter "*server*.exe" | ForEach-Object { | |
| Write-Host "Found: $($_.FullName)" | |
| } | |
| Write-Host "All .exe files:" | |
| Get-ChildItem -Recurse -Filter "*.exe" | ForEach-Object { | |
| Write-Host "Found: $($_.FullName)" | |
| } | |
| exit 1 | |
| } | |
| - name: Install Visual C++ Redistributable (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| Write-Host "Installing Visual C++ Redistributable..." | |
| # Download and install VC++ Redistributable to fix DLL issues | |
| $vcredistUrl = "https://aka.ms/vs/17/release/vc_redist.x64.exe" | |
| Invoke-WebRequest -Uri $vcredistUrl -OutFile "vc_redist.x64.exe" | |
| Start-Process -FilePath "vc_redist.x64.exe" -ArgumentList "/quiet" -Wait | |
| Write-Host "VC++ Redistributable installed" | |
| - name: Download test model (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| run: | | |
| mkdir -p models | |
| curl -L -o models/Lucy-Q4_0.gguf "https://huggingface.co/Menlo/Lucy-gguf/resolve/main/Lucy-Q4_0.gguf" | |
| - name: Download test model (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| if (-not (Test-Path "models")) { | |
| New-Item -ItemType Directory -Path "models" | |
| } | |
| Invoke-WebRequest -Uri "https://huggingface.co/Menlo/Lucy-gguf/resolve/main/Lucy-Q4_0.gguf" -OutFile "models\Lucy-Q4_0.gguf" | |
| - name: Verify binary (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| run: | | |
| echo "Testing binary basic functionality..." | |
| ./llama/build/bin/${{ matrix.binary-name }} --version || echo "Version check completed (exit code: $?)" | |
| echo "Available arguments:" | |
| ./llama/build/bin/${{ matrix.binary-name }} --help || echo "Help check completed (exit code: $?)" | |
| - name: Verify binary (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| Write-Host "Testing binary basic functionality..." | |
| # Test version command with better error handling | |
| try { | |
| $process = Start-Process -FilePath ".\llama\build\bin\${{ matrix.binary-name }}" ` | |
| -ArgumentList "--version" ` | |
| -RedirectStandardOutput "version_output.txt" ` | |
| -RedirectStandardError "version_error.txt" ` | |
| -Wait -PassThru -WindowStyle Hidden | |
| Write-Host "Version command exit code: $($process.ExitCode)" | |
| if (Test-Path "version_output.txt") { | |
| $versionContent = Get-Content "version_output.txt" -Raw | |
| if ($versionContent) { | |
| Write-Host "Version output:" | |
| Write-Host $versionContent | |
| } | |
| } | |
| if (Test-Path "version_error.txt") { | |
| $errorContent = Get-Content "version_error.txt" -Raw | |
| if ($errorContent) { | |
| Write-Host "Version stderr:" | |
| Write-Host $errorContent | |
| } | |
| } | |
| } catch { | |
| Write-Host "Version check failed: $($_.Exception.Message)" | |
| } | |
| # Test help command | |
| try { | |
| $helpProcess = Start-Process -FilePath ".\llama\build\bin\${{ matrix.binary-name }}" ` | |
| -ArgumentList "--help" ` | |
| -RedirectStandardOutput "help_output.txt" ` | |
| -RedirectStandardError "help_error.txt" ` | |
| -Wait -PassThru -WindowStyle Hidden | |
| Write-Host "Help command exit code: $($helpProcess.ExitCode)" | |
| if (Test-Path "help_output.txt") { | |
| $helpContent = Get-Content "help_output.txt" -Raw | |
| if ($helpContent) { | |
| Write-Host "Help output (first 200 chars):" | |
| Write-Host $helpContent.Substring(0, [Math]::Min(200, $helpContent.Length)) | |
| } | |
| } | |
| if (Test-Path "help_error.txt") { | |
| $errorContent = Get-Content "help_error.txt" -Raw | |
| if ($errorContent) { | |
| Write-Host "Help stderr:" | |
| Write-Host $errorContent | |
| } | |
| } | |
| } catch { | |
| Write-Host "Help check failed: $($_.Exception.Message)" | |
| } | |
| # Clean up temp files | |
| Remove-Item -Path "version_output.txt", "version_error.txt", "help_output.txt", "help_error.txt" -ErrorAction SilentlyContinue | |
| Write-Host "Binary verification completed" | |
| - name: Test direct completion (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| timeout-minutes: 5 | |
| run: | | |
| echo "Testing direct completion mode..." | |
| # Test basic completion without server mode | |
| echo "Trying simple completion..." | |
| timeout 60s ./llama/build/bin/${{ matrix.binary-name }} \ | |
| -m models/Lucy-Q4_0.gguf \ | |
| -p "Hello" \ | |
| -n 3 \ | |
| -c 256 \ | |
| --n-gpu-layers 0 \ | |
| --temp 0.1 > completion_output.txt 2>&1 || true | |
| if [ -s completion_output.txt ]; then | |
| echo "[PASSED] Direct completion test successful" | |
| echo "Completion output:" | |
| head -10 completion_output.txt | |
| else | |
| echo "[INFO] Direct completion mode not available or failed" | |
| echo "This is expected for server-only binaries" | |
| fi | |
| - name: Test direct completion (Windows) | |
| if: runner.os == 'Windows' | |
| timeout-minutes: 5 | |
| shell: pwsh | |
| run: | | |
| Write-Host "Testing direct completion mode..." | |
| try { | |
| # Test basic completion without server mode | |
| $process = Start-Process -FilePath ".\llama\build\bin\${{ matrix.binary-name }}" ` | |
| -ArgumentList "-m", "models\Lucy-Q4_0.gguf", "-p", "Hello", "-n", "3", "-c", "256", "--n-gpu-layers", "0", "--temp", "0.1" ` | |
| -RedirectStandardOutput "completion_output.txt" ` | |
| -RedirectStandardError "completion_error.txt" ` | |
| -Wait -PassThru -WindowStyle Hidden | |
| Write-Host "Completion process exit code: $($process.ExitCode)" | |
| if (Test-Path "completion_output.txt") { | |
| $completionContent = Get-Content "completion_output.txt" -Raw | |
| if ($completionContent -and $completionContent.Length -gt 0) { | |
| Write-Host "[PASSED] Direct completion test successful" | |
| Write-Host "Completion output (first 200 chars):" | |
| Write-Host $completionContent.Substring(0, [Math]::Min(200, $completionContent.Length)) | |
| } else { | |
| Write-Host "[INFO] Direct completion mode not available" | |
| } | |
| } | |
| if (Test-Path "completion_error.txt") { | |
| $errorContent = Get-Content "completion_error.txt" -Raw | |
| if ($errorContent) { | |
| Write-Host "Completion stderr:" | |
| Write-Host $errorContent | |
| } | |
| } | |
| } catch { | |
| Write-Host "[INFO] Direct completion test failed: $($_.Exception.Message)" | |
| Write-Host "This is expected for server-only binaries" | |
| } | |
| # Clean up | |
| Remove-Item -Path "completion_output.txt", "completion_error.txt" -ErrorAction SilentlyContinue | |
| - name: Test server startup (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| timeout-minutes: 5 | |
| run: | | |
| echo "Testing ${{ matrix.binary-name }} server startup..." | |
| # Start server in background with better error handling | |
| ./llama/build/bin/${{ matrix.binary-name }} \ | |
| --model models/Lucy-Q4_0.gguf \ | |
| --port 8080 --host 127.0.0.1 \ | |
| --ctx-size 256 \ | |
| --n-gpu-layers 0 \ | |
| --log-format text > server.log 2>&1 & | |
| SERVER_PID=$! | |
| echo "Server PID: $SERVER_PID" | |
| sleep 15 # Give server more time to fully initialize | |
| # Check if process is still running | |
| if ! kill -0 $SERVER_PID 2>/dev/null; then | |
| echo "[FAILED] Server process died" | |
| echo "Server log:" | |
| cat server.log || echo "No server log" | |
| exit 1 | |
| fi | |
| echo "Server appears to be running, testing endpoints..." | |
| # Wait for server to be ready with better endpoint detection | |
| SERVER_READY=false | |
| for i in {1..30}; do | |
| # Try multiple common endpoints | |
| if curl -s --max-time 3 http://127.0.0.1:8080/health >/dev/null 2>&1; then | |
| echo "[PASSED] Server responding on /health" | |
| SERVER_READY=true | |
| break | |
| elif curl -s --max-time 3 http://127.0.0.1:8080/ >/dev/null 2>&1; then | |
| echo "[PASSED] Server responding on /" | |
| SERVER_READY=true | |
| break | |
| elif curl -s --max-time 3 http://127.0.0.1:8080/v1/models >/dev/null 2>&1; then | |
| echo "[PASSED] Server responding on /v1/models" | |
| SERVER_READY=true | |
| break | |
| fi | |
| echo "Attempt $i/30 - waiting for server..." | |
| sleep 2 | |
| done | |
| if [ "$SERVER_READY" = "false" ]; then | |
| echo "[FAILED] Server not responding within timeout" | |
| echo "Last 20 lines of server log:" | |
| tail -20 server.log || echo "No server log" | |
| kill $SERVER_PID 2>/dev/null || true | |
| exit 1 | |
| fi | |
| # Test inference if server is ready | |
| echo "Testing completion endpoint..." | |
| RESPONSE=$(curl -s --max-time 10 -X POST http://127.0.0.1:8080/completion \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "prompt": "Hello", | |
| "n_predict": 3, | |
| "temperature": 0.1 | |
| }' 2>/dev/null || echo "") | |
| if [ -n "$RESPONSE" ] && (echo "$RESPONSE" | grep -q "content\|text\|choices" 2>/dev/null); then | |
| echo "[PASSED] Server inference test successful" | |
| echo "Response: $RESPONSE" | head -c 200 | |
| else | |
| echo "[WARNING] Inference test failed, but server is running" | |
| echo "Response: $RESPONSE" | |
| fi | |
| kill $SERVER_PID 2>/dev/null || true | |
| echo "Server test completed" | |
| - name: Test server startup (Windows) | |
| if: runner.os == 'Windows' | |
| timeout-minutes: 5 | |
| shell: pwsh | |
| run: | | |
| Write-Host "Testing ${{ matrix.binary-name }} server startup..." | |
| # Start server with better process handling | |
| $process = Start-Process -FilePath ".\llama\build\bin\${{ matrix.binary-name }}" ` | |
| -ArgumentList "--model", "models\Lucy-Q4_0.gguf", "--port", "8080", "--host", "127.0.0.1", "--n-gpu-layers", "0", "--ctx-size", "256", "--log-format", "text" ` | |
| -WindowStyle Hidden -PassThru -RedirectStandardOutput "server_output.log" -RedirectStandardError "server_error.log" | |
| Write-Host "Server PID: $($process.Id)" | |
| # Give server more time to start | |
| Start-Sleep -Seconds 20 | |
| if ($process.HasExited) { | |
| Write-Host "[FAILED] Server process exited" | |
| Write-Host "Exit code: $($process.ExitCode)" | |
| Write-Host "Server output:" | |
| if (Test-Path "server_output.log") { Get-Content "server_output.log" } | |
| Write-Host "Server errors:" | |
| if (Test-Path "server_error.log") { Get-Content "server_error.log" } | |
| exit 1 | |
| } | |
| # Test server endpoints with better error handling | |
| $serverResponded = $false | |
| for ($i = 1; $i -le 20; $i++) { | |
| try { | |
| # Try multiple endpoints | |
| $endpoints = @("/health", "/", "/v1/models") | |
| foreach ($endpoint in $endpoints) { | |
| try { | |
| $response = Invoke-RestMethod -Uri "http://127.0.0.1:8080$endpoint" -Method Get -TimeoutSec 5 | |
| Write-Host "[PASSED] Server responding on $endpoint" | |
| $serverResponded = $true | |
| break | |
| } catch { | |
| # Continue to next endpoint | |
| } | |
| } | |
| if ($serverResponded) { break } | |
| } catch { | |
| Write-Host "Attempt $i/20 - connection error" | |
| } | |
| Start-Sleep -Seconds 3 | |
| } | |
| if (-not $serverResponded) { | |
| Write-Host "[FAILED] Server failed to respond" | |
| Write-Host "Server output (last 20 lines):" | |
| if (Test-Path "server_output.log") { Get-Content "server_output.log" | Select-Object -Last 20 } | |
| Write-Host "Server errors:" | |
| if (Test-Path "server_error.log") { Get-Content "server_error.log" } | |
| Stop-Process -Id $process.Id -Force -ErrorAction SilentlyContinue | |
| exit 1 | |
| } | |
| # Test inference | |
| try { | |
| $body = @{ | |
| prompt = "Hello" | |
| n_predict = 3 | |
| temperature = 0.1 | |
| } | ConvertTo-Json | |
| $response = Invoke-RestMethod -Uri "http://127.0.0.1:8080/completion" -Method Post -Body $body -ContentType "application/json" -TimeoutSec 10 | |
| Write-Host "[PASSED] Server inference test successful" | |
| $response | ConvertTo-Json -Depth 2 -Compress | |
| } catch { | |
| Write-Host "[WARNING] Inference test failed, but server is running" | |
| Write-Host "Error: $($_.Exception.Message)" | |
| } | |
| Stop-Process -Id $process.Id -Force -ErrorAction SilentlyContinue | |
| Write-Host "Server test completed" | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results-${{ matrix.os }}-${{ matrix.name }}-${{ env.TEST_VERSION }} | |
| path: | | |
| *.json | |
| *.log | |
| *.txt | |
| retention-days: 1 | |
| test-summary: | |
| needs: test-binaries | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Test Summary | |
| run: | | |
| echo "## Binary Test Results for ${{ env.TEST_VERSION }}" >> $GITHUB_STEP_SUMMARY | |
| echo "**Version tested:** ${{ env.TEST_VERSION }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if [ "${{ needs.test-binaries.result }}" = "success" ]; then | |
| echo "### ✅ All binary tests passed!" >> $GITHUB_STEP_SUMMARY | |
| echo "- Binaries start successfully" >> $GITHUB_STEP_SUMMARY | |
| echo "- Model loading works correctly" >> $GITHUB_STEP_SUMMARY | |
| echo "- Server endpoints respond properly" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "### ❌ Some binary tests failed" >> $GITHUB_STEP_SUMMARY | |
| echo "Check individual job logs for details." >> $GITHUB_STEP_SUMMARY | |
| fi | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Test Strategy:**" >> $GITHUB_STEP_SUMMARY | |
| echo "- Direct completion test (fallback for CLI-only binaries)" >> $GITHUB_STEP_SUMMARY | |
| echo "- Server mode test with multiple endpoint detection" >> $GITHUB_STEP_SUMMARY | |
| echo "- Inference API validation" >> $GITHUB_STEP_SUMMARY |