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 8aa40c0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 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:
benchmark:
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
30 changes: 2 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:

github:
name: Deploy to GitHub
needs: [ build ]
needs: [build]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-22.04
steps:
Expand All @@ -75,7 +75,7 @@ jobs:

nuget:
name: Deploy to NuGet
needs: [ build ]
needs: [build]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-22.04
steps:
Expand All @@ -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 8aa40c0

Please sign in to comment.