diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml new file mode 100644 index 0000000..7e55cbc --- /dev/null +++ b/.github/workflows/benchmarks.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7d3ac3..6b8cf07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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: @@ -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