Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/publish-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@ jobs:
run: |
cp -r api-reference/guide api-reference/${{ env.friendly-version }}/guide

- name: 'Download benchmark results'
uses: actions/download-artifact@v8
with:
pattern: benchmark-*
path: /tmp/benchmarks
merge-multiple: true

- name: 'Inject benchmark results into guide for v${{ env.friendly-version }}'
shell: bash
run: |
find /tmp/benchmarks -name "*-report-github.md" | sort | xargs -r cat > /tmp/benchmark_results.md
awk '/{benchmarks_section}/{while((getline line < "/tmp/benchmark_results.md") > 0) print line; close("/tmp/benchmark_results.md"); next} {print}' \
"api-reference/${{ env.friendly-version }}/guide/benchmarks.md" > /tmp/benchmarks.md
mv /tmp/benchmarks.md "api-reference/${{ env.friendly-version }}/guide/benchmarks.md"

- name: 'Discover all versions'
id: discover-versions
shell: bash
Expand Down
41 changes: 3 additions & 38 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ permissions:
id-token: write
contents: write

concurrency:
group: pull-request-${{ github.head_ref || github.ref }}
concurrency:
group: pull-request-${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
Expand Down Expand Up @@ -189,7 +189,7 @@ jobs:
- name: Pack with .NET
run: |
dotnet pack ${{ vars.SRC_DEFAULT_GLOB_PATTERN }} --configuration ${{ env.build-configuration }} /p:Platform="${{ env.build-platform }}" /p:PackageVersion=${{ env.release-version }} /p:Version=${{ env.assembly-version }} /p:AssemblyInformationalVersion=${{ env.assembly-informational-version }} /p:FileVersion=${{ env.file-version }} --output ${{ runner.temp }}/${{ env.nuget-packages-directory }}

- name: Upload Package
uses: actions/upload-artifact@v7
with:
Expand Down Expand Up @@ -239,38 +239,3 @@ jobs:

- name: 'Check for vulnerable packages'
run: dotnet list src/PolylineAlgorithm/PolylineAlgorithm.csproj package --vulnerable --include-transitive

benchmark:
if: ${{ needs.workflow-variables.outputs.is-release == 'true' || vars.BENCHMARKDOTNET_RUN_OVERRIDE == 'true' }}
name: Benchmark with .NET CLI on ${{ matrix.os }}
needs: [workflow-variables, build]
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: 'Checkout ${{ github.head_ref || github.ref }}'
uses: actions/checkout@v6
- name: Install .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.x
10.x
- name: Download Build
uses: actions/download-artifact@v8
with:
name: build
- name: Benchmark
working-directory: ${{ vars.BENCHMARKDOTNET_WORKING_DIRECTORY }}
run: dotnet run --configuration ${{ env.build-configuration }} /p:Platform=${{ env.build-platform }} --framework ${{ vars.DEFAULT_BUILD_FRAMEWORK }} --runtimes ${{ vars.BENCHMARKDOTNET_RUNTIMES }} --filter ${{ vars.BENCHMARKDOTNET_FILTER }} --artifacts ${{ runner.temp }}/benchmarks/ --exporters GitHub --memory --iterationTime 100 --join
- name: Upload Benchmark Results
uses: actions/upload-artifact@v7
with:
name: benchmark-${{ matrix.os }}
path: |
${{ runner.temp }}/benchmarks/**/*-report-github.md
- name: Write Benchmark Summary
shell: bash
run: cat **/*-report-github.md > $GITHUB_STEP_SUMMARY
working-directory: ${{ runner.temp }}/benchmarks/
37 changes: 36 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,44 @@ jobs:
${{ runner.temp }}/${{ env.nuget-packages-directory }}/**/*.nupkg
${{ runner.temp }}/${{ env.nuget-packages-directory }}/**/*.snupkg

benchmark:
name: Benchmark with .NET CLI on ${{ matrix.os }}
needs: [workflow-variables, build, validate-release]
if: ${{ needs.workflow-variables.outputs.is-release == 'true' || vars.BENCHMARKDOTNET_RUN_OVERRIDE == 'true' }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: 'Checkout ${{ github.head_ref || github.ref }}'
uses: actions/checkout@v6
- name: Install .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.x
10.x
- name: Download Build
uses: actions/download-artifact@v8
with:
name: build
- name: Benchmark
working-directory: ${{ vars.BENCHMARKDOTNET_WORKING_DIRECTORY }}
run: dotnet run --configuration ${{ env.build-configuration }} /p:Platform=${{ env.build-platform }} --framework ${{ vars.DEFAULT_BUILD_FRAMEWORK }} --runtimes ${{ vars.BENCHMARKDOTNET_RUNTIMES }} --filter ${{ vars.BENCHMARKDOTNET_FILTER }} --artifacts ${{ runner.temp }}/benchmarks/ --exporters GitHub --memory --iterationTime 100 --join
- name: Upload Benchmark Results
uses: actions/upload-artifact@v7
with:
name: benchmark-${{ matrix.os }}
path: |
${{ runner.temp }}/benchmarks/**/*-report-github.md
- name: Write Benchmark Summary
shell: bash
run: cat **/*-report-github.md > $GITHUB_STEP_SUMMARY
working-directory: ${{ runner.temp }}/benchmarks/

publish-documentation:
name: 'Publish documentation'
needs: [pack, validate-release, workflow-variables]
needs: [pack, benchmark, validate-release, workflow-variables]
if: ${{ needs.workflow-variables.outputs.is-release == 'true' }}
uses: ./.github/workflows/publish-documentation.yml
permissions:
Expand Down
11 changes: 11 additions & 0 deletions api-reference/guide/benchmarks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Benchmarks
---
# Benchmarks

Performance benchmarks for **PolylineAlgorithm for .NET** measured using [BenchmarkDotNet](https://benchmarkdotnet.org/).

> [!NOTE]
> Benchmarks are generated automatically during the release process. Results may vary depending on hardware and runtime version.

{benchmarks_section}
2 changes: 2 additions & 0 deletions api-reference/guide/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
href: sample.md
- name: FAQ
href: faq.md
- name: Benchmarks
href: benchmarks.md
Loading