Skip to content

Bump System.CommandLine from 2.0.0-beta4.22272.1 to 2.0.0-rc.1.25451.107 #127

Bump System.CommandLine from 2.0.0-beta4.22272.1 to 2.0.0-rc.1.25451.107

Bump System.CommandLine from 2.0.0-beta4.22272.1 to 2.0.0-rc.1.25451.107 #127

Workflow file for this run

name: PR Validation
on:
pull_request:
branches: [main]
paths:
- "src/**"
- "tests/**"
- "samples/**"
- "*.sln"
- "**/*.csproj"
- ".github/workflows/pr-validation.yml"
- "scripts/download-openvino-runtime.*"
env:
OPENVINO_VERSION: "2025.3.0.0.dev20250805"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build-and-test:
name: Build and Test
runs-on: windows-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Cache OpenVINO Runtime
id: cache-openvino
uses: actions/cache@v4
with:
path: build/native/runtimes/win-x64/native
key: openvino-runtime-${{ env.OPENVINO_VERSION }}-v2
- name: Download and Setup OpenVINO Runtime
shell: pwsh
run: |
$targetPath = "build/native/runtimes/win-x64/native"
# Check if cache was restored and has DLLs
if (Test-Path $targetPath) {
$dllCount = (Get-ChildItem -Path $targetPath -Filter *.dll -ErrorAction SilentlyContinue | Measure-Object).Count
if ($dllCount -gt 0) {
Write-Host "Using cached OpenVINO runtime: $dllCount DLLs found" -ForegroundColor Green
exit 0
}
}
# Download if not cached or invalid cache
Write-Host "Downloading OpenVINO runtime..." -ForegroundColor Yellow
./scripts/download-openvino-runtime.ps1 -Version "$env:OPENVINO_VERSION" -OutputPath "build/native"
- name: Set OPENVINO_RUNTIME_PATH
shell: pwsh
run: |
$runtimePath = "$(Get-Location)/build/native/runtimes/win-x64/native"
"OPENVINO_RUNTIME_PATH=$runtimePath" | Out-File -FilePath $env:GITHUB_ENV -Append
Write-Host "Set OPENVINO_RUNTIME_PATH to: $runtimePath"
# Verify the runtime path exists and contains DLLs
if (Test-Path $runtimePath) {
$dllCount = (Get-ChildItem -Path $runtimePath -Filter *.dll | Measure-Object).Count
Write-Host "Found $dllCount DLL files in runtime path"
Get-ChildItem -Path $runtimePath -Filter "openvino*.dll" | ForEach-Object { Write-Host " - $_" }
} else {
Write-Host "ERROR: Runtime path does not exist: $runtimePath" -ForegroundColor Red
exit 1
}
- name: Restore dependencies
run: dotnet restore Fluid.OpenVINO.sln
- name: Build solution
shell: pwsh
run: |
Write-Host "Building with OPENVINO_RUNTIME_PATH: $env:OPENVINO_RUNTIME_PATH"
dotnet build Fluid.OpenVINO.sln --configuration Release --no-restore /p:TreatWarningsAsErrors=true
env:
CI: true
- name: Run unit tests
shell: pwsh
run: |
Write-Host "Running tests with OPENVINO_RUNTIME_PATH: $env:OPENVINO_RUNTIME_PATH"
# Check if DLLs were copied to test output directory
$testOutputPath = "tests/OpenVINO.NET.GenAI.Tests/bin/Release/net8.0"
if (Test-Path $testOutputPath) {
$dllCount = (Get-ChildItem -Path $testOutputPath -Filter "*.dll" | Measure-Object).Count
Write-Host "Test output directory contains $dllCount DLL files"
# Check specifically for OpenVINO DLLs
$openvinoDlls = Get-ChildItem -Path $testOutputPath -Filter "openvino*.dll" -ErrorAction SilentlyContinue
if ($openvinoDlls) {
Write-Host "Found OpenVINO DLLs in test output:"
$openvinoDlls | ForEach-Object { Write-Host " - $_" }
} else {
Write-Host "WARNING: No OpenVINO DLLs found in test output directory" -ForegroundColor Yellow
}
}
dotnet test tests/OpenVINO.NET.GenAI.Tests/OpenVINO.NET.GenAI.Tests.csproj `
--configuration Release `
--no-build `
--verbosity normal `
--logger "trx;LogFileName=test-results.trx" `
--collect:"XPlat Code Coverage" `
--results-directory ./TestResults
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: TestResults/
- name: Test Report
uses: dorny/test-reporter@v2
if: always()
with:
name: .NET Test Results
path: TestResults/*.trx
reporter: dotnet-trx
fail-on-error: true
- name: Code Coverage Report
if: false # Disabled: Container action not supported on Windows runners
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: TestResults/**/coverage.cobertura.xml
badge: true
format: markdown
output: both
- name: Add Coverage PR Comment
if: false # Disabled: Depends on code coverage report
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
path: code-coverage-results.md
code-quality:
name: Code Quality Checks
runs-on: windows-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore Fluid.OpenVINO.sln
- name: Check formatting
run: dotnet format Fluid.OpenVINO.sln --verify-no-changes --verbosity diagnostic
- name: Run code analysis
run: |
dotnet build Fluid.OpenVINO.sln --configuration Release /p:EnableNETAnalyzers=true /p:AnalysisMode=AllEnabledByDefault