Skip to content

Commit 88f4ee1

Browse files
Copilotpetesramek
andauthored
feat: add benchmarks to api-reference on version deploy
Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/00d2cb8d-24e6-447f-9432-1196121e727c Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
1 parent 1dd28dd commit 88f4ee1

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/publish-documentation.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,32 @@ jobs:
9696
run: |
9797
cp -r api-reference/guide api-reference/${{ env.friendly-version }}/guide
9898
99+
- name: 'Run benchmarks for v${{ env.friendly-version }}'
100+
shell: bash
101+
env:
102+
benchmarks-artifacts: /tmp/benchmarks
103+
run: |
104+
dotnet run \
105+
--project benchmarks/PolylineAlgorithm.Benchmarks/PolylineAlgorithm.Benchmarks.csproj \
106+
--configuration Release \
107+
--framework ${{ vars.DEFAULT_BUILD_FRAMEWORK || 'net10.0' }} \
108+
-- --filter ${{ vars.BENCHMARKDOTNET_FILTER || '*' }} \
109+
--exporters GitHub \
110+
--memory \
111+
--iterationTime 100 \
112+
--join \
113+
--artifacts ${{ env.benchmarks-artifacts }}/
114+
115+
- name: 'Inject benchmark results into guide for v${{ env.friendly-version }}'
116+
shell: bash
117+
env:
118+
benchmarks-artifacts: /tmp/benchmarks
119+
run: |
120+
find ${{ env.benchmarks-artifacts }} -name "*-report-github.md" | sort | xargs cat > /tmp/benchmark_results.md
121+
awk '/{benchmarks_section}/{while((getline line < "/tmp/benchmark_results.md") > 0) print line; close("/tmp/benchmark_results.md"); next} {print}' \
122+
"api-reference/${{ env.friendly-version }}/guide/benchmarks.md" > /tmp/benchmarks.md
123+
mv /tmp/benchmarks.md "api-reference/${{ env.friendly-version }}/guide/benchmarks.md"
124+
99125
- name: 'Discover all versions'
100126
id: discover-versions
101127
shell: bash

api-reference/guide/benchmarks.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Benchmarks
3+
---
4+
# Benchmarks
5+
6+
Performance benchmarks for **PolylineAlgorithm for .NET** measured using [BenchmarkDotNet](https://benchmarkdotnet.org/).
7+
8+
> [!NOTE]
9+
> Benchmarks are generated automatically during the release process. Results may vary depending on hardware and runtime version.
10+
11+
{benchmarks_section}

api-reference/guide/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
href: sample.md
99
- name: FAQ
1010
href: faq.md
11+
- name: Benchmarks
12+
href: benchmarks.md

0 commit comments

Comments
 (0)