|
| 1 | +name: Manual Windows Benchmark |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + repeats: |
| 7 | + description: Measured repetitions for each warm operation |
| 8 | + required: false |
| 9 | + default: '5' |
| 10 | + type: string |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +jobs: |
| 16 | + windows-benchmark: |
| 17 | + name: Build, install, and benchmark Windows CLI |
| 18 | + runs-on: windows-2025 |
| 19 | + timeout-minutes: 240 |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 22 | + |
| 23 | + - uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2 |
| 24 | + with: |
| 25 | + msystem: CLANG64 |
| 26 | + path-type: inherit |
| 27 | + install: >- |
| 28 | + mingw-w64-clang-x86_64-clang |
| 29 | + mingw-w64-clang-x86_64-zlib |
| 30 | + mingw-w64-clang-x86_64-python3 |
| 31 | + make |
| 32 | + git |
| 33 | + coreutils |
| 34 | + zip |
| 35 | +
|
| 36 | + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 |
| 37 | + with: |
| 38 | + node-version: '22' |
| 39 | + |
| 40 | + - name: Build native Windows binary |
| 41 | + shell: msys2 {0} |
| 42 | + run: scripts/build.sh --with-ui CC=clang CXX=clang++ |
| 43 | + |
| 44 | + - name: Install exact built binary and run benchmark |
| 45 | + shell: pwsh |
| 46 | + env: |
| 47 | + BENCH_REPEATS: ${{ inputs.repeats }} |
| 48 | + run: | |
| 49 | + $ErrorActionPreference = 'Stop' |
| 50 | + $repo = (Get-Location).Path |
| 51 | + $binary = Join-Path $repo 'build\c\codebase-memory-cli.exe' |
| 52 | + $install = Join-Path $env:RUNNER_TEMP 'cbm-installed' |
| 53 | + $workspace = Join-Path $env:RUNNER_TEMP 'cbm-benchmark-repos' |
| 54 | + $results = Join-Path $env:RUNNER_TEMP 'cbm-benchmark-results' |
| 55 | + & pwsh -NoProfile -File (Join-Path $repo 'scripts\setup-windows.ps1') ` |
| 56 | + -Binary $binary -InstallDir $install -NoPathPrompt |
| 57 | + if ($LASTEXITCODE) { throw 'binary installation failed' } |
| 58 | + & pwsh -NoProfile -File (Join-Path $repo 'scripts\qualification\run-windows-benchmark-corpus.ps1') ` |
| 59 | + -CandidateBinary (Join-Path $install 'codebase-memory-cli.exe') ` |
| 60 | + -WorkspaceRoot $workspace -ResultsRoot $results ` |
| 61 | + -CodebaseMemoryRef $env:GITHUB_SHA -Repeats ([int]$env:BENCH_REPEATS) -Initialize |
| 62 | + if ($LASTEXITCODE) { throw 'Windows benchmark failed' } |
| 63 | +
|
| 64 | + - name: Upload benchmark evidence |
| 65 | + if: always() |
| 66 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 67 | + with: |
| 68 | + name: windows-benchmark-${{ github.run_id }} |
| 69 | + path: ${{ runner.temp }}/cbm-benchmark-results |
| 70 | + if-no-files-found: warn |
0 commit comments