Skip to content

Commit

Permalink
ci: extract benchmarks workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
phnx47 committed Oct 22, 2023
1 parent f0262f6 commit 9cdf01e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 26 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Benchmarks

on:
pull_request:
branches:
- "main"
workflow_dispatch:

jobs:
benchmarks:
name: Benchmarks
if: !startsWith(github.ref, 'refs/heads/renovate')
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Run all benchmarks
working-directory: tests/benchmarks
run: dotnet run -c Release -- -f *
- name: Add summary
working-directory: tests/benchmarks/BenchmarkDotNet.Artifacts/results
run: cat FingerprintBuilder.BenchmarkTests.ModelToHex-report-github.md >> $GITHUB_STEP_SUMMARY
- name: Add PR comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: tests/benchmarks/BenchmarkDotNet.Artifacts/results/FingerprintBuilder.BenchmarkTests.ModelToHex-report-github.md
26 changes: 0 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,3 @@ jobs:
name: nupkgs
- name: Push to NuGet
run: dotnet nuget push "**/*.nupkg" -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json

benchmarks:
name: Benchmarks
if: github.event_name != 'push' && !startsWith(github.ref, 'refs/heads/renovate')
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Run all benchmarks
working-directory: tests/benchmarks
run: dotnet run -c Release -- -f *
- name: Add summary
working-directory: tests/benchmarks/BenchmarkDotNet.Artifacts/results
run: cat FingerprintBuilder.BenchmarkTests.ModelToHex-report-github.md >> $GITHUB_STEP_SUMMARY
- name: Add PR comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: tests/benchmarks/BenchmarkDotNet.Artifacts/results/FingerprintBuilder.BenchmarkTests.ModelToHex-report-github.md

0 comments on commit 9cdf01e

Please sign in to comment.