diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml new file mode 100644 index 0000000..46b1cc8 --- /dev/null +++ b/.github/workflows/benchmarks.yml @@ -0,0 +1,34 @@ +name: CI + +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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7d3ac3..f539e99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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