Add community and covariate records for pipeline parity #11
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: CI | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| branches: [ main ] | |
| env: | |
| DOTNET_VERSION: '9.0.x' | |
| SOLUTION_FILE: GraphRag.slnx | |
| jobs: | |
| build: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Restore dependencies | |
| run: dotnet restore ${{ env.SOLUTION_FILE }} | |
| - name: Build | |
| run: dotnet build ${{ env.SOLUTION_FILE }} --configuration Release --no-restore | |
| - name: Test | |
| run: dotnet test ${{ env.SOLUTION_FILE }} --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" | |
| - name: Upload coverage reports to Codecov | |
| if: always() | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./**/coverage.cobertura.xml | |
| fail_ci_if_error: false | |
| cosmos-emulator: | |
| name: Cosmos Emulator Tests | |
| runs-on: windows-latest | |
| env: | |
| DOTNET_VERSION: '9.0.x' | |
| SOLUTION_FILE: GraphRag.slnx | |
| COSMOS_EMULATOR_CONNECTION_STRING: AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== | |
| GRAPHRAG_SKIP_TESTCONTAINERS: '1' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Install Cosmos DB Emulator | |
| shell: pwsh | |
| run: choco install azure-cosmosdb-emulator --yes --no-progress | |
| - name: Start Cosmos DB Emulator | |
| shell: pwsh | |
| run: | | |
| $emulatorPath = "${env:ProgramFiles}\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" | |
| if (-not (Test-Path $emulatorPath)) { | |
| throw "Cosmos DB Emulator executable not found at $emulatorPath" | |
| } | |
| Start-Process -FilePath $emulatorPath -ArgumentList "/EnablePreview","/NoUI","/DisableTelemetry","/Start" -Wait:$false | |
| $certPath = Join-Path $env:TEMP "cosmos-emulator.pem" | |
| $maxAttempts = 60 | |
| for ($attempt = 0; $attempt -lt $maxAttempts; $attempt++) { | |
| try { | |
| Invoke-WebRequest -Uri https://localhost:8081/_explorer/emulator.pem -OutFile $certPath -SkipCertificateCheck | |
| break | |
| } catch { | |
| Start-Sleep -Seconds 2 | |
| } | |
| } | |
| if ($attempt -eq $maxAttempts) { | |
| throw "Cosmos DB Emulator did not start within expected time." | |
| } | |
| "COSMOS_EMULATOR_CERT_PATH=$certPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Import Cosmos Emulator Certificate | |
| shell: pwsh | |
| run: | | |
| $certPemPath = $env:COSMOS_EMULATOR_CERT_PATH | |
| if (-not (Test-Path $certPemPath)) { | |
| throw "Emulator certificate not found at $certPemPath" | |
| } | |
| $pemContent = Get-Content $certPemPath -Raw | |
| $certificate = [System.Security.Cryptography.X509Certificates.X509Certificate2]::CreateFromPem($pemContent) | |
| $certBytes = $certificate.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert) | |
| $certFile = Join-Path $env:TEMP "cosmos-emulator.cer" | |
| [System.IO.File]::WriteAllBytes($certFile, $certBytes) | |
| Import-Certificate -FilePath $certFile -CertStoreLocation Cert:\LocalMachine\Root | Out-Null | |
| - name: Restore dependencies | |
| shell: pwsh | |
| run: dotnet restore $env:SOLUTION_FILE | |
| - name: Build | |
| shell: pwsh | |
| run: dotnet build $env:SOLUTION_FILE --configuration Release --no-restore | |
| - name: Test Cosmos scenarios | |
| shell: pwsh | |
| run: dotnet test $env:SOLUTION_FILE --configuration Release --no-build --verbosity normal --filter "Category=Cosmos" |