mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-16 13:35:28 +00:00
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:
66
.github/workflows/performance-benchmarks.yml
vendored
Normal file
66
.github/workflows/performance-benchmarks.yml
vendored
Normal 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/
|
||||
Reference in New Issue
Block a user