Prepare release performance gates #16
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: PR validation | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| env: | |
| DOTNET_VERSION: '10.0.x' | |
| jobs: | |
| validate: | |
| name: Build, test, and pack | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Restore dependencies | |
| run: dotnet restore MarkdownLd.Kb.slnx | |
| - name: Verify formatting | |
| run: dotnet format MarkdownLd.Kb.slnx --verify-no-changes --no-restore | |
| - name: Build | |
| run: dotnet build MarkdownLd.Kb.slnx --configuration Release --no-restore | |
| - name: Test with coverage | |
| run: dotnet test --solution MarkdownLd.Kb.slnx --configuration Release --verbosity normal -- --coverage --coverage-output-format cobertura --coverage-output "${{ github.workspace }}/TestResults/TUnitCoverage/coverage.cobertura.xml" --coverage-settings "${{ github.workspace }}/CodeCoverage.runsettings" | |
| - name: Pack | |
| run: dotnet pack MarkdownLd.Kb.slnx --configuration Release -p:IncludeSymbols=false -p:SymbolPackageFormat=snupkg --output ./artifacts | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage | |
| path: TestResults/TUnitCoverage/coverage.cobertura.xml | |
| retention-days: 5 | |
| - name: Upload package artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: nuget-validation-packages | |
| path: ./artifacts/*.nupkg | |
| retention-days: 5 | |
| benchmark: | |
| name: BenchmarkDotNet (${{ matrix.suite }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - suite: fuzzy-edit-distance | |
| filter: '*FuzzyEditDistanceBenchmarks*' | |
| - suite: graph-build | |
| filter: '*GraphBuildBenchmarks*' | |
| - suite: graph-search | |
| filter: '*GraphSearchBenchmarks*' | |
| - suite: tiktoken-search | |
| filter: '*TiktokenSearchBenchmarks*' | |
| - suite: graph-persistence | |
| filter: '*GraphPersistenceBenchmarks*' | |
| - suite: graph-lifecycle | |
| filter: '*GraphLifecycleBenchmarks*' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Restore dependencies | |
| run: dotnet restore MarkdownLd.Kb.slnx | |
| - name: Build | |
| run: dotnet build MarkdownLd.Kb.slnx --configuration Release --no-restore | |
| - name: Run ${{ matrix.suite }} benchmarks | |
| run: dotnet run --project benchmarks/MarkdownLd.Kb.Benchmarks -c Release -- --filter "${{ matrix.filter }}" | |
| - name: Upload benchmark artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: benchmarkdotnet-results-${{ matrix.suite }} | |
| path: artifacts/benchmarks/results | |
| if-no-files-found: error | |
| retention-days: 5 |