Add GitHub Actions workflow, baseline results, and documentation for performance benchmarks

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-05 13:32:23 +00:00
parent 2541c09973
commit ca262920c8
20 changed files with 251 additions and 2128 deletions

View File

@@ -0,0 +1,66 @@
name: Performance Benchmarks
on:
push:
branches:
- 'master'
- 'release'
pull_request:
branches:
- 'master'
- 'release'
workflow_dispatch:
permissions:
contents: read
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Build Performance Project
run: dotnet build tests/SharpCompress.Performance/SharpCompress.Performance.csproj --configuration Release
- name: Run Benchmarks
run: dotnet run --project tests/SharpCompress.Performance/SharpCompress.Performance.csproj --configuration Release --no-build -- --filter "*" --exporters json markdown --artifacts benchmark-results
continue-on-error: true
- name: Display Benchmark Results
if: always()
run: |
echo "## Benchmark Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -d "benchmark-results/results" ]; then
for file in benchmark-results/results/*-report-github.md; do
if [ -f "$file" ]; then
cat "$file" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
fi
done
fi
- name: Compare with Baseline
if: always()
run: |
echo "## Comparison with Baseline" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Baseline results are stored in tests/SharpCompress.Performance/baseline-results.md" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Baseline Results" >> $GITHUB_STEP_SUMMARY
cat tests/SharpCompress.Performance/baseline-results.md >> $GITHUB_STEP_SUMMARY || echo "Baseline file not found" >> $GITHUB_STEP_SUMMARY
- name: Upload Benchmark Results
if: always()
uses: actions/upload-artifact@v6
with:
name: benchmark-results
path: benchmark-results/