Add CI/CD benchmarking

This commit is contained in:
Asriel Camora
2023-11-09 17:47:08 -08:00
parent e49a3142d2
commit 20aa7e9565
2 changed files with 55 additions and 2 deletions
+53 -1
View File
@@ -74,4 +74,56 @@ jobs:
with: with:
token: ${{secrets.PAT}} token: ${{secrets.PAT}}
repository: ${{env.PLUGIN_REPO}} repository: ${{env.PLUGIN_REPO}}
event-type: new-release 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
+2 -1
View File
@@ -16,7 +16,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.8" /> <PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.10" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.92"> <PackageReference Include="Meziantou.Analyzer" Version="2.0.92">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>