Skip to content

Commit

Permalink
Add CI/CD benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
WorkingRobot committed Nov 10, 2023
1 parent e49a314 commit 20aa7e9
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
54 changes: 53 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,56 @@ jobs:
with:
token: ${{secrets.PAT}}
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
3 changes: 2 additions & 1 deletion Benchmark/Craftimizer.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
</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">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit 20aa7e9

Please sign in to comment.