From 6e268c9199d0609350c7652ba38b7e26ba8a3fe7 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Tue, 29 Oct 2024 11:11:35 +0700 Subject: [PATCH] enable benchmarking comments --- .github/workflows/test.yaml | 18 +++++++++++++++++- .../DataModelPerformanceTests.cs | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 65494e2..8fbc8fb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,4 +19,20 @@ jobs: uses: actions/setup-dotnet@v4 - name: Build & test - run: dotnet test --configuration Release --logger GitHubActions \ No newline at end of file + run: dotnet test --configuration Release --logger GitHubActions + - name: Download previous benchmark data + uses: actions/cache@v4 + with: + path: ./cache + key: ${{ runner.os }}-benchmark + - name: Continuous Benchmark + uses: benchmark-action/github-action-benchmark@v1.20.4 + with: + tool: benchmarkdotnet + output-file-path: src\artifacts\bin\SIL.Harmony.Tests\release\BenchmarkDotNet.Artifacts\results\SIL.Harmony.Tests.DataModelPerformanceBenchmarks-report-full-compressed.json + external-data-json-path: ./cache/benchmark-data.json + fail-on-alert: true + summary-always: true + comment-always: true + github-token: ${{ secrets.GITHUB_TOKEN }} + \ No newline at end of file diff --git a/src/SIL.Harmony.Tests/DataModelPerformanceTests.cs b/src/SIL.Harmony.Tests/DataModelPerformanceTests.cs index 48073d5..0674aaf 100644 --- a/src/SIL.Harmony.Tests/DataModelPerformanceTests.cs +++ b/src/SIL.Harmony.Tests/DataModelPerformanceTests.cs @@ -29,6 +29,7 @@ public void AddingChangePerformance() var summary = BenchmarkRunner.Run( ManualConfig.CreateEmpty() + .AddExporter(JsonExporter.FullCompressed) .AddColumnProvider(DefaultColumnProviders.Instance) .AddLogger(new XUnitBenchmarkLogger(output)) );