|
| 1 | +name: Benchmark Comparison |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - ".github/workflows/benchmark-comparison.yml" |
| 7 | + - "dotnet/**" |
| 8 | + - "packages/**" |
| 9 | + - "scripts/benchmark_smoke.py" |
| 10 | + - "tests/fixtures/**" |
| 11 | + - "tests/unit/test_benchmark_smoke.py" |
| 12 | + - "pyproject.toml" |
| 13 | + - "uv.lock" |
| 14 | + pull_request: |
| 15 | + types: |
| 16 | + - opened |
| 17 | + - reopened |
| 18 | + - synchronize |
| 19 | + - ready_for_review |
| 20 | + paths: |
| 21 | + - ".github/workflows/benchmark-comparison.yml" |
| 22 | + - "dotnet/**" |
| 23 | + - "packages/**" |
| 24 | + - "scripts/benchmark_smoke.py" |
| 25 | + - "tests/fixtures/**" |
| 26 | + - "tests/unit/test_benchmark_smoke.py" |
| 27 | + - "pyproject.toml" |
| 28 | + - "uv.lock" |
| 29 | + |
| 30 | +permissions: |
| 31 | + contents: read |
| 32 | + pull-requests: read |
| 33 | + |
| 34 | +concurrency: |
| 35 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 36 | + cancel-in-progress: true |
| 37 | + |
| 38 | +jobs: |
| 39 | + benchmark: |
| 40 | + if: github.event.pull_request.draft == false |
| 41 | + runs-on: ubuntu-latest |
| 42 | + env: |
| 43 | + DEBUG: 1 |
| 44 | + GRAPHRAG_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 45 | + GRAPHRAG_API_BASE: ${{ secrets.GRAPHRAG_API_BASE }} |
| 46 | + AZURE_AI_SEARCH_URL_ENDPOINT: ${{ secrets.AZURE_AI_SEARCH_URL_ENDPOINT }} |
| 47 | + AZURE_AI_SEARCH_API_KEY: ${{ secrets.AZURE_AI_SEARCH_API_KEY }} |
| 48 | + BLOB_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1 |
| 49 | + LOCAL_BLOB_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1 |
| 50 | + |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v4 |
| 53 | + |
| 54 | + - uses: actions/setup-python@v5 |
| 55 | + with: |
| 56 | + python-version: "3.13" |
| 57 | + |
| 58 | + - uses: actions/setup-dotnet@v4 |
| 59 | + with: |
| 60 | + dotnet-version: "10.0.x" |
| 61 | + |
| 62 | + - uses: astral-sh/setup-uv@v6 |
| 63 | + |
| 64 | + - name: Install dependencies |
| 65 | + shell: bash |
| 66 | + run: uv sync --all-packages |
| 67 | + |
| 68 | + - name: Build .NET |
| 69 | + run: dotnet build dotnet/ --configuration Release |
| 70 | + |
| 71 | + - name: Install and start Azurite |
| 72 | + shell: bash |
| 73 | + run: | |
| 74 | + npm install -g azurite |
| 75 | + azurite --silent --skipApiVersionCheck --location /tmp/azurite --debug /tmp/azurite-debug.log & |
| 76 | +
|
| 77 | + - name: Benchmark Python implementation |
| 78 | + run: | |
| 79 | + uv run python scripts/benchmark_smoke.py run \ |
| 80 | + --implementation python \ |
| 81 | + --repo-root "${{ github.workspace }}" \ |
| 82 | + --output benchmark-python.json |
| 83 | +
|
| 84 | + - name: Benchmark .NET implementation |
| 85 | + run: | |
| 86 | + uv run python scripts/benchmark_smoke.py run \ |
| 87 | + --implementation dotnet \ |
| 88 | + --repo-root "${{ github.workspace }}" \ |
| 89 | + --output benchmark-dotnet.json |
| 90 | +
|
| 91 | + - name: Generate comparison report |
| 92 | + run: | |
| 93 | + uv run python scripts/benchmark_smoke.py compare \ |
| 94 | + --python-results benchmark-python.json \ |
| 95 | + --dotnet-results benchmark-dotnet.json \ |
| 96 | + --output benchmark-comparison.md |
| 97 | + cat benchmark-comparison.md >> "$GITHUB_STEP_SUMMARY" |
| 98 | +
|
| 99 | + - uses: actions/upload-artifact@v4 |
| 100 | + if: always() |
| 101 | + with: |
| 102 | + name: benchmark-comparison |
| 103 | + path: | |
| 104 | + benchmark-python.json |
| 105 | + benchmark-dotnet.json |
| 106 | + benchmark-comparison.md |
0 commit comments