diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8613830..7a57589 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -74,4 +74,56 @@ jobs: with: token: ${{secrets.PAT}} repository: ${{env.PLUGIN_REPO}} - event-type: new-release \ No newline at end of file + event-type: new-release + + bench: + runs-on: windows-latest + env: + DOTNET_CLI_TELEMETRY_OPTOUT: true + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '7.0' + + - name: Download Dalamud + run: | + Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -OutFile latest.zip + Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev\" + + - name: Restore + run: | + dotnet restore -r win + + - name: Benchmark + run: | + dotnet run --configuration Release --project Benchmark -- -e json html github csv -f * -d -m --counters BranchMispredictions+CacheMisses+TotalCycles + + - name: Cache Benchmark Data + uses: actions/cache@v1 + with: + path: ./bench-cache + key: ${{runner.os}}-${{ github.head_ref || github.ref_name }}-benchmark + + - name: Publish Benchmarks + uses: rhysd/github-action-benchmark@v1 + with: + tool: benchmarkdotnet + output-file-path: BenchmarkDotNet.Artifacts/results/Craftimizer.Benchmark-report-full-compressed.json + external-data-json-path: ./bench-cache/external.json + github-token: ${{secrets.GITHUB_TOKEN}} + comment-always: true + alert-threshold: '150%' + alert-comment-cc-users: '@${{github.actor}}' + + - name: Upload Test Results + uses: actions/upload-artifact@v3 + with: + name: BenchmarkResults + path: BenchmarkDotNet.Artifacts/results \ No newline at end of file diff --git a/Benchmark/Craftimizer.Benchmark.csproj b/Benchmark/Craftimizer.Benchmark.csproj index 3012dd1..deabbf4 100644 --- a/Benchmark/Craftimizer.Benchmark.csproj +++ b/Benchmark/Craftimizer.Benchmark.csproj @@ -16,7 +16,8 @@ - + + all runtime; build; native; contentfiles; analyzers; buildtransitive